Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Curl http code 100 and failing
    text
    copied!<p>I'm trying to use a web service with php curl but I'm getting the http code "100" and an "Recv failure: Connection was reset" error.. I tested the web service with google chrome's extension "Postman -REST Client" and it works perfectly. I searched this http code and it looks like the server is expecting a body request data but I don't know what it's expecting me to send since I'm not posting any data, just the headers.</p> <p>My code looks like this:</p> <pre><code>error_reporting(-1); $header = array('Content-Length: 1831', 'Content-Type: application/json', 'Authorization: '. $authorization, 'Authorization-Admin: '. $authorization_admin); $url = 'http://api.bookingreports.com/public/1/analytics/reports/departures'; $ch = curl_init($url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLINFO_HEADER_OUT, true); $result = curl_exec($ch); $errorCode = curl_getinfo($ch, CURLINFO_HEADER_OUT); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); echo $result; echo curl_error($ch); echo $errorCode; echo $httpcode; //log_message('debug', 'HTTP HEADER '. $errorCode); curl_close($ch); </code></pre> <p>and the header I'm sending looks like this:</p> <pre><code>POST /public/1/analytics/reports/departures HTTP/1.1 Host: api.bookingreports.com Accept: */* Content-Length: 1831 Content-Type: application/json Authorization: myauthcode Authorization-Admin: myauthadmin Expect: 100-continue </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload