[PHP-NOTES] note 130559 added to function.curl-setopt

[email protected] ("[email protected]") Fri, 28 Nov 2025 23:02:50 +0000
Newsgroups php.notes
Message-ID <[email protected]>
Be reminded that setting CURLOPT_POST to 0 or false will reset the request type to GET, or to whatever you set with CURLOPT_CUSTOMREQUEST.

So if you do set CURLOPT_PUT or CURLOPT_UPLOAD to true and then do CURLOPT_POST to 0 or false, you will not get any body in your request, even though the method you receive might be PUT (as set in CURLOPT_CUSTOMREQUEST), this could be quite confusing.
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 2a02:8429:27d2:9a01:4827:377d:f354:b45d)
----
Manual Page -- https://php.net/manual/en/function.curl-setopt.php
Edit        -- https://main.php.net/note/edit/130559
Del: integrated  -- https://main.php.net/note/delete/130559/integrated
Del: useless     -- https://main.php.net/note/delete/130559/useless
Del: bad code    -- https://main.php.net/note/delete/130559/bad+code
Del: spam        -- https://main.php.net/note/delete/130559/spam
Del: non-english -- https://main.php.net/note/delete/130559/non-english
Del: in docs     -- https://main.php.net/note/delete/130559/in+docs
Del: other reasons-- https://main.php.net/note/delete/130559
Reject      -- https://main.php.net/note/reject/130559
Search      -- https://main.php.net/manage/user-notes.php