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
HTTPotion and HTTPoison both wrap responses in similar structs. Considering an (optional?) struct for mapping responses, using the existing structure.
This seems like it'd work well for when you want the body directly, but poorly for fine grained response handling, like streaming. For example, HTTPoison wants the entire struct passed in as part of an {:async :once} request.
It seems like we'd need at least these structs to cover all cases.
# most cases are async.HttpBuilder.AsyncChunkHttpBuilder.AsyncEndHttpBuilder.AsyncHeadersHttpBuilder.AsyncRedirectHttpBuilder.AsyncResponseHttpBuilder.AsyncStatusHttpBuilder.AsyncRawRequestHttpBuilder.AsyncTimeout# but small apis can just await a response.HttpBuilder.Response
A possible top-level implementation, adding an options argument to HttpBuilder.send/1
client()|>get("/items")|>send([map: true])
Or as a new method altogether.
client()|>get("/items")|>send()|>map()
The text was updated successfully, but these errors were encountered:
HTTPotion and HTTPoison both wrap responses in similar structs. Considering an (optional?) struct for mapping responses, using the existing structure.
This seems like it'd work well for when you want the body directly, but poorly for fine grained response handling, like streaming. For example, HTTPoison wants the entire struct passed in as part of an
{:async :once}
request.It seems like we'd need at least these structs to cover all cases.
A possible top-level implementation, adding an options argument to
HttpBuilder.send/1
Or as a new method altogether.
The text was updated successfully, but these errors were encountered: