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

WBOY
Release: 2016-08-08 09:06:51
Original
2244 people have browsed it

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);

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!