php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #27202 document all curl constants
Submitted: 2004-02-10 04:46 UTC Modified: 2004-08-07 02:06 UTC
From: leander2 at berwers dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
 [2004-02-10 04:46 UTC] leander2 at berwers dot com
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.


Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-10 11:14 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

You need to set curl_setopt($ch, CURLOPT_HTTPGET, 1); for 
the 2nd request, the  
curl_setopt($ch, CURLOPT_URL,"http://second"); 
curl_setopt($ch, CURLOPT_POST, 0); 
 
are not needed for request #2. 
 [2004-07-24 23:11 UTC] fido at list dot pl
Sorry to bother You, but could You point me to a place in manual where this option is described?? 
I searched it a few times (with and without Ctrl+F) and couldn't find it. Maybe this "feature" is not yet documented?
I've lost a few hours today fighting with this.. and gave up. I did it by reinitiating CURL.
 [2004-07-25 02:01 UTC] philip@php.net
Marking this as a documentation problem and rewriting the summary as 'document all curl constants'.

All curl constants should be documented (or perhaps mention that all are not, at least until they are), here is a complete list:

http://lxr.php.net/source/php-src/ext/curl/interface.c#130

Wow, there sure are a lot of curl constants! :)  List of constants go here:

http://cvs.php.net/phpdoc/en/reference/curl/constants.xml

Docs (with useful information) goes here:

http://cvs.php.net/phpdoc/en/reference/curl/functions/curl-setopt.xml
 [2004-08-07 02:06 UTC] dave@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Aug 16 04:01:28 2024 UTC