Home  >  Article  >  Backend Development  >  302 - Why does php curl simulate post request always return 302?

302 - Why does php curl simulate post request always return 302?

WBOY
WBOYOriginal
2016-08-08 09:06:512248browse

Why does php curl simulate post request always return 302

Reply content:

Why does php curl simulate post request always return 302

302 Redirect
Maybe the address you visit requires login and you bring a cookie if you don’t request it

How do you specifically request it? Please post the code to see. There is another situation. I guess the service you are using is nginx! nginxIf the reverse proxy is not bound properlyip, curlrequest 302

will appear

It may be because you do not carry cookies, or it may be that the website itself performs a 302 jump. The former carries cookies when posting, and the latter sets curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn