Handle correctly p1_http:request result

This commit is contained in:
Badlop 2016-11-16 13:11:23 +01:00
parent 2929f5b5bc
commit b1723c6e2d
1 changed files with 2 additions and 2 deletions

View File

@ -272,9 +272,9 @@ geturl(Url, Hdrs, UsrOpts) ->
_ -> []
end,
case p1_http:request(get, Url, Hdrs, [], Host++User++UsrOpts++[{version, "HTTP/1.0"}]) of
{ok, {{_, 200, _}, Headers, Response}} ->
{ok, 200, Headers, Response} ->
{ok, Headers, Response};
{ok, {{_, Code, _}, _Headers, Response}} ->
{ok, Code, _Headers, Response} ->
{error, {Code, Response}};
{error, Reason} ->
{error, Reason}