![]() In order to dig further, the option CURLOPT_VERBOSE might help you to have extra information about the request behavior through the STDERR. In any case the reply to your question why your request does not get an error, I guess that the use of the option CURLOPT_NOSIGNAL and the different timeout options explained in the set_opt php manual might get you closer to it. So you send the https request insecurely over http on your local network, to a local cache, then have the cache fetch it securely as https across the open internet. Once you have the header with the code you are interested, you could run a php script that echoes the curl response and parse it by yourself: false, You want to make an https request and have it complete like this: client <-http-> cache <-https-> remote server.In this stackoverflow question CURLOPT_RETURNTRANSFER set to true doesnt work on hosting server, you can see that that the option CURLOPT_RETURNTRANSFER is directly affected by the requested host web server implementation.Īs you are using explicitly the response body, and your code relies on the response headers, a good way to solve this might be to: CURLOPT_RETURNTRANSFER => falseĪnd execute the curl code to work on the response headers. ![]() The server might not give a successful reply or, at least, a successful reply within the timeframe that curl has to receive the response and cache it, so the results are returned by the curl into the variable you assign. My experience working with curl showed me that sometimes when using the option: CURLOPT_RETURNTRANSFER => true I'll now follow suggestions given on this site for that kind of failure. So, I have found the why – thank you – and apparently was right and it is a network problem. (using code from this answer) and found the following in $curl_log when an URL failed (URL and IP changed): * About to connect() to port 80 (#0) So apparently the slowness of the failing URL is not a problem in itself for cURL.įollowing suggestion in his answer, I used: CURLOPT_VERBOSE => 1,
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |