302-why does phpcurl always return 302 for post requests?

Source: Internet
Author: User
Why does phpcurl always return 302 when simulating post requests? why does php curl always return 302 when simulating post requests?

Reply content:

Why does php curl always return 302 for post requests?

302 redirection
Maybe you need to log on to the address you accessed, and bring the cookie when you do not have a request

Paste the code to see how you request it. In another case, I guess the service you are using is notNginxAh!NginxThe reverse proxy is not bound.IpYesCurlRequest 302

It may be because you do not carry a cookie or because the website itself performs a 302 redirect. The former is post with a cookie, and the latter is set.Curl_setopt ($ curl, CURLOPT_FOLLOWLOCATION, 1 );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.