Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to return the body immediately, rather than a ref #184

Closed
rlipscombe opened this issue Apr 21, 2015 · 1 comment
Closed

Add an option to return the body immediately, rather than a ref #184

rlipscombe opened this issue Apr 21, 2015 · 1 comment

Comments

@rlipscombe
Copy link

For simple REST-type calls, it'd be useful if there was an option I could pass that would read the entire response body and return it instead of the ref usually returned.

@benoitc benoitc modified the milestone: 2.0.0 Jun 16, 2015
@benoitc
Copy link
Owner

benoitc commented Jun 25, 2015

I added the option [with_body] to do it. It will be available in next release:

2> hackney:get("https://friendpaste.com", [], <<>>, [with_body]).
{ok,200,
    [{<<"Server">>,<<"nginx/0.7.62">>},
     {<<"Date">>,<<"Thu, 25 Jun 2015 13:48:27 GMT">>},
     {<<"Content-Type">>,<<"text/html; charset=utf-8">>},
     {<<"Transfer-Encoding">>,<<"chunked">>},
     {<<"Connection">>,<<"keep-alive">>},
     {<<"Set-Cookie">>,
      <<"FRIENDPASTE_SID=16555235843a2c686b0acc1708bb0938b55505b1;
expires=Thu, 0"...>>},
     {<<"Access-Control-Allow-Origin">>,<<"None">>},
     {<<"Access-Control-Allow-Credentials">>,<<"true">>},
     {<<"Access-Control-Allow-Methods">>,
      <<"POST, GET, PUT, DELETE, OPTIONS">>},
     {<<"Access-Control-Allow-Headers">>,
      <<"X-Requested-With, X-HTTP-Method-Override, Content-Type, "...>>},
     {<<"Access-Control-Max-Age">>,<<"86400">>}],
    <<"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta
charset=\"utf-8\"/>\n    <title>Friendpaste - Welcome"...>>}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants