curl authenticates but no web page is returned

前端 未结 2 744
暗喜
暗喜 2021-01-23 13:29

This script AUTHs successfully but it wont return the webpage correctly, the server returns.

HTTP/1.1 100 Continue HTTP/1.1 303 See Other Date: Thu, 18 Oct 2012
         


        
相关标签:
2条回答
  • 2021-01-23 13:57

    CURLOPT_HEADER doesn't mention anything about excluding the body. http://php.net/manual/en/function.curl-setopt.php

    But maybe your page is redirecting more than 10 times? Maybe add

    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    

    and then post your new headers.

    0 讨论(0)
  • 2021-01-23 14:05

    When you set the CURLOPT_POSTFIELDS with an array, CURL sets request type to multipart/form-data while server expects application/x-www-form-urlencoded, so you need to encode the string yourself with the help of urlencode

    0 讨论(0)
提交回复
热议问题