You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar #99, request headers may come from user input. For example, a proxy application may need to pass all headers from an incoming request along to an upstream server. It would be nice if the headers argument could also take the header name as a string both to preserve case and also to avoid converting user input to atoms.
With Elixir >= 1.4, an argument error is raised when passing a list of tuples with string keys:
Interactive Elixir (1.4.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> HTTPotion.get "http://httpbin.org/get", headers: [{"foo", "bar"}]
** (ArgumentError) expected a keyword list as the second argument, got: [{"foo", "bar"}]
(elixir) lib/keyword.ex:589: Keyword.merge/2
(httpotion) lib/httpotion.ex:355: HTTPotion.process_arguments/3
(httpotion) lib/httpotion.ex:355: HTTPotion.request/3
Right now I'm looking at the documentation and online resources and I'm seeing this exact problem and figuring out what the exact syntax is to set headers to make a get request, it's more challenging than it should be, and the documentation needs to be updated so that newcomers know how to use the tool.
Similar #99, request headers may come from user input. For example, a proxy application may need to pass all headers from an incoming request along to an upstream server. It would be nice if the
headers
argument could also take the header name as a string both to preserve case and also to avoid converting user input to atoms.With Elixir >= 1.4, an argument error is raised when passing a list of tuples with string keys:
However, this usage succeeds with Elixir < 1.4
The text was updated successfully, but these errors were encountered: