Re: Implicit message type with curl_easy_perform, and how to CURLOPT_PUT/CURLOPT_UPLOAD?
Date: Thu, 11 Apr 2019 03:31:36 -0400
On 4/11/2019 2:54 AM, Dan Fandrich wrote:
> On Wed, Apr 10, 2019 at 07:28:33PM -0400, Ray Satiro wrote:
>> There is no dedicated option to PUT a string in a resource. The easiest
>> way (but not the most correct) is piggyback off a POST option and
>> disable (or change) the content-type and method.
> IIRC, just setting CURLOPT_UPLOAD = 1 on an HTTP URL does a PUT.
Yeah but that overrides CURLOPT_POSTFIELDS (the behavior may be
different depending on the order but either way I'm pretty sure it's not
correct). What I was saying is CURLOPT_UPLOAD should be used with
CURLOPT_READFUNCTION and CURLOPT_SEEKFUNCTION to upload a string via PUT
since there's no CURLOPT_POSTFIELDS equivalent like
CURLOPT_PUTBUF/CURLOPT_PUTBUFSIZE or something.