hackney 0.8.0 is a major release of hackney. With this release the API will not evolve much until the
1.0 release sometimes in january.
Changes
- breaking change: hackney now return a reference instead of an opaque record. The
information is maintained in an ETS table. The same reference is now
used for async response requests.
Before you were doing
{ok, Status, RespHeaders, Client1} = hackney:request(Method, URL,
Headers, Payload,
Options),
{ok, Body, Client2} = hackney:body(Client1).
And you needed to keep around the last opaque Client
record. Now you only need to pass the reference you get when you start the request:
{ok, Status, RespHeaders, Ref} = hackney:request(Method, URL,
Headers, Payload,
Options),
{ok, Body} = hackney:body(Ref).
This change has been done to make the api simpler while keeping all the features available in hackney (in particularly you still don't pass messages by default in hackney). Also the same reference is now used when you decide to receive the response asynchronously. Have a look in the README for more informations.
- breaking change:
stream_body_request/2
andstream_multipart_request/2
functions has
been renamed tosend_body/2
andsend_multipart_body/2
. - breaking change: remove
hackney:close_stream/1
function. You only need to
usehackney:close/1
now. - breaking change: rename
hackney:raw/1
function to
hackney:cancel_request/1
. - breaking change: the hakney pool handler based on dispcount is now
available in its own repository so hackney doe not depends on dispcount. - fix: canceling and closing a request now make sure the async response
process is killed. - fix: make sure we pass a
Transfer-Encoding: chunked
header when we
send a body without content-length. - fix: make sure the client is correctly reconnected when we reuse a
reference.
The full changelog is available here: 0.7.0...0.8.0
Hackney is also available as a source archive or via expm.
Enjoy!