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
There's a major oversight in this library, GET request parameters are never generated!
For instance calling Lurker.statuses(conn, user_id, [max_id: post_id] ) will never generate a request with max_id set.
URL parameters with HTTPoison can be passed in two ways:
via setting :params in HTTPoison.Request and request/1.
by passing parameters in options = [params: [max_id: post_id]] via request/5
This library does neither.
It always JSON encodes options and passes them into the body as with :post requests, since the options passed are Config.http_options() by default and request/1 is never used.
This leaves :get 14 api's with options silently dysfunctional, making for quite a headache.
I'm quite surprised no one has yet to catch this misbehavior.
There ought to be a nicer solution than sticking
options =
Config.http_options() ++
if method == :get do
[params: payload]
else
[]
end
in Hunter.Api.HTTPClient.request! and
body =
if http_method != :get do
process_request_body(data)
else
""
end
in Lurker.Api.Request.request
But it works for now, and other things are waiting to get finished first.
The text was updated successfully, but these errors were encountered:
There's a major oversight in this library, GET request parameters are never generated!
For instance calling
Lurker.statuses(conn, user_id, [max_id: post_id] )
will never generate a request with max_id set.URL parameters with HTTPoison can be passed in two ways:
options = [params: [max_id: post_id]]
via request/5https://hexdocs.pm/httpoison/HTTPoison.Request.html#content
This library does neither.
It always JSON encodes options and passes them into the body as with :post requests, since the options passed are Config.http_options() by default and request/1 is never used.
This leaves :get 14 api's with options silently dysfunctional, making for quite a headache.
I'm quite surprised no one has yet to catch this misbehavior.
There ought to be a nicer solution than sticking
in Hunter.Api.HTTPClient.request! and
in Lurker.Api.Request.request
But it works for now, and other things are waiting to get finished first.
The text was updated successfully, but these errors were encountered: