9
$\begingroup$

Bug introduced in V11.0 and persisting through 11.3

[CASE:3981157] confirmed


asso = <| "Scheme" -> "http" , "Domain" -> "www.wolframalpha.com/" , "ContentType" -> "application/json" |>; 

This is a valid and documented syntax:

HTTPRequest @ asso //InputForm 
HTTPRequest[ <|"Scheme" -> "http", "Domain" -> "www.wolframalpha.com/"|> , <|"ContentType" -> "application/json"|> ] 

but it breaks when one provides options:

HTTPRequest[asso, CharacterEncoding -> Automatic] // InputForm 
HTTPRequest[ <|"Scheme" -> "http", "Domain" -> "www.wolframalpha.com/", "ContentType" -> "application/json"|> , <||> , CharacterEncoding -> Automatic ] 

So it was not split correctly on url and metadata part. Which will result in malformed request.

Have I missed something?

$\endgroup$

1 Answer 1

3
$\begingroup$

So before it is fixed one needs to arrange full input with help of e.g. URLBuild:

HTTPRequest[ URLBuild@asso, asso, CharacterEncoding -> Automatic ] // InputForm 
HTTPRequest[ "http://www.wolframalpha.com//" , <|..., "ContentType" -> "application/json"|> , CharacterEncoding -> Automatic ] 
$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.