curl-library
Re: HTTP PUT Without Callbacks
Date: Thu, 23 Feb 2017 09:44:06 -0800
I will try out setting CURLOPT_CUSTOMREQUEST to "PUT". Thanks!
> I wouldn't mind seeing that supported withot having to use
CURLOPT_CUSTOMREQUEST, no.
Sorry, I couldn't tell whether you mean you would like to see that
supported and therefore *would* consider a feature request, or "no", you
wouldn't want it supported because it's unnecessary due to
CURLOPT_CUSTOMREQUEST
allowing it to be worked around...
On Thu, Feb 23, 2017 at 2:46 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Wed, 22 Feb 2017, corey kasten wrote:
>
> Is there a way to control the number of bytes that the curl engine will
>> request when it calls my read_callback, which, if there were, I could
>> return all the data in one callback invocation allowing me to not have to
>> keep state of the offset?
>>
>
> No.
>
> Am I right that I would have to do things this way?
>>
>
> You can also opt to use CURLOPT_POSTFIELDS and just set
> CURLOPT_CUSTOMREQUEST to "PUT"... (which works fine as long as you need
> libcurl to follow redirects for you as well).
>
> If so, does it work this way because of some inherent difference between
>> HTTP POST and HTTP PUT that allows the simpler interface for POST
>> (CURLOPT_POSTFIELDS + CURLOPT_POSTFIELDSIZE) than the PUT requiring a
>> read_callback?
>>
>
> It works like that simply because HTTP PUT is generally made for "file
> upload" so the API is more focused on such a use case.
>
> If not, would you consider feature request to allow PUT to be supported by
>> the same type of interface with which POST is supported (in addition to the
>> current interface for PUT)?
>>
>
> I wouldn't mind seeing that supported withot having to use
> CURLOPT_CUSTOMREQUEST, no.
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
> Etiquette: https://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2017-02-23