From: leander2 at berwers dot com
Operating system: Linux
PHP version: Irrelevant
PHP Bug Type: cURL related
Bug description: CURLOPT_POSTFIELDS and CURLOPT_POST don't work properly
Description:
------------
CURLOPT_POST = 0 and/or CURLOPT_POSTFIELDS = null does actually do a POST
while a GET is required
Reproduce code:
---------------
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://first");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $b);
$x = curl_exec($ch);
curl_setopt($ch, CURLOPT_URL,"http://second");
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, null);
curl_close($ch);
Expected result:
----------------
The first request should be a POST and the second request should be a GET.
Actual result:
--------------
The first request is a POST (which is ok), but the second request is also
a POST.
--
Edit bug report at http://bugs.php.net/?id=27202&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27202&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27202&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=27202&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=27202&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=27202&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=27202&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=27202&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=27202&r=support
Expected behavior: http://bugs.php.net/fix.php?id=27202&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=27202&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=27202&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=27202&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27202&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=27202&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=27202&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=27202&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27202&r=float