Home >Backend Development >PHP Tutorial >302 - Why does php curl simulate post request always return 302?
Why does php curl simulate post request always return 302
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
! nginx
If the reverse proxy is not bound properlyip
, curl
request 302
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);