I'm using curl to post to a script.
curl_setopt ($ch, CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$postvars);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0);
But there's 301 redirect involved which casues curl to switch from POST to GET.
HTTP/1.1 301 Moved Permanently < Location: https://myserver.org/php/callback-f.php < Content-Length: 0 < Date: Wed, 16 Nov 2011 17:21:06 GMT < Server: lighttpd/1.4.28 * Connection #0 to host myserver.org left intact * Issue another request to this URL: 'https://myserver.org/php/callback-f.php' * Violate RFC 2616/10.3.2 and switch from POST to GET * About to connect() to myserver.org port 443
Does anyone know how I can prevent curl from switching to GET please?