Answer the question
In order to leave comments, you need to log in
Why doesn't autoredirect work in httpc:request [Erlang]?
There is a request code:
httpc:request(post,
{Url, [],
"application/x-www-form-urlencoded",
"param1=1"
}, [], [])
{ok,{{"HTTP/1.1",301,"Moved Permanently"},
[{"connection","keep-alive"},
{"date","Mon, 02 Nov 2015 14:34:38 GMT"},
{"location","http://site.ru/new"},
{"server","nginx"},
{"content-length","249"},
{"content-type","text/html; charset=iso-8859-1"},
{"keep-alive","timeout=60"}],
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>301 Moved Permanently</title>\n</head><body>\n<h1>Moved Permanently</h1>\n<p>The document has moved <a href=\"http://site.ru/new\">here</a>.</p>\n</body></html>\n"}}
autoredirect
The client automatically retrieves the information from the new URI and returns that as the result, instead of a 30X-result code.
For some 30X-result codes, automatic redirect is not allowed. In these cases the 30X-result is always returned.
default is true.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question