Re: Ranged PUTs, Content-Range, and Content-Length
On Tue, 30 Apr 2019, m brandenberg via curl-library wrote: https://tools.ietf.org/html/rfc7231#section-4.3.4 True but organizations that publish stable, long-lived APIs don't switch from 2616 to 7231 overnight. RFC 7231 is not a new or different standard, it is instead how HTTP/1.1 was interpreted by "everyone" so by following that I would claim we're likely to be *more* compliant rather than less. Still, the only "MUST NOT" wording regarding Content- headers that I find with PUT in RFC 2616 section 9 says this: The recipient of the entity MUST NOT ignore any Content-* (e.g. Content-Range) headers that it does not understand or implement and MUST return a 501 (Not Implemented) response in such cases. I don't think RFC 7231 contradicts this and I don't think curl does anything that works against this either. curl's behavior when attempting upload resume should rather simply mostly cause servers to respond with an error response. Both according to RFC 2616 and 7231. From my reading of them. -- / daniel.haxx.se --- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.html
Re: Ranged PUTs, Content-Range, and Content-Length
On Tue, 30 Apr 2019, Daniel Stenberg wrote: RFC 2616 is obsoleted by RFC 7231 and its section 4.3.4 which says: An origin server that allows PUT on a given target resource MUST send a 400 (Bad Request) response to a PUT request that contains a Content-Range header field (Section 4.2 of [RFC7233]), since the payload is likely to be partial content that has been mistakenly PUT as a full representation. Partial content updates are possible by targeting a separately identified resource with state that overlaps a portion of the larger resource, or by using a different method that has been specifically defined for partial updates (for example, the PATCH method defined in [RFC5789]). https://tools.ietf.org/html/rfc7231#section-4.3.4 True but organizations that publish stable, long-lived APIs don't switch from 2616 to 7231 overnight. m -- Monty Brandenberg, Software Engineer MCB, Inc. mcb...@panix.com P.O. Box 425292 mcb...@pobox.com Cambridge, MA 02142-0006 617.864.6907 --- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.html
Re: Ranged PUTs, Content-Range, and Content-Length
On Tue, 30 Apr 2019, m brandenberg via curl-library wrote: Well, 2616 specifically defines some "MUST NOT" behavior around this case (PUT + "Content-*" headers): https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html So being able to send that combination correctly may be a reasonable expectation. RFC 2616 is obsoleted by RFC 7231 and its section 4.3.4 which says: An origin server that allows PUT on a given target resource MUST send a 400 (Bad Request) response to a PUT request that contains a Content-Range header field (Section 4.2 of [RFC7233]), since the payload is likely to be partial content that has been mistakenly PUT as a full representation. Partial content updates are possible by targeting a separately identified resource with state that overlaps a portion of the larger resource, or by using a different method that has been specifically defined for partial updates (for example, the PATCH method defined in [RFC5789]). https://tools.ietf.org/html/rfc7231#section-4.3.4 -- / daniel.haxx.se --- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.html
Re: Ranged PUTs, Content-Range, and Content-Length
On Tue, 30 Apr 2019, Daniel Stenberg via curl-library wrote: On Tue, 30 Apr 2019, Ray Satiro via curl-library wrote: CURLOPT_RANGE specifically as far as I know is only supposed to be used for download, not upload (can anyone confirm?), This is correct. There's actually no standard way to do ranged "uploads" for HTTP, just various more or less working hacks. PATCH (RFC 5789) was the fix for that. Well, 2616 specifically defines some "MUST NOT" behavior around this case (PUT + "Content-*" headers): https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html So being able to send that combination correctly may be a reasonable expectation. m -- Monty Brandenberg, Software Engineer MCB, Inc. mcb...@panix.com P.O. Box 425292 mcb...@pobox.com Cambridge, MA 02142-0006 617.864.6907 --- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.html
Re: curl-library Digest, Vol 164, Issue 28
Hi, Tatyana, On Tue, Apr 30, 2019 at 5:37 AM Татьяна Комиссарова via curl-library wrote: > > I want to use Curl in a C++ program in Microsoft Visual Studio. What purpose it will be Reading E-mails? Reading some files remotely? Receive some data from the remote host? Also - there are multiple code sample on the cURL web-site and a lot of documentation there. Did you look at that? Thank you. > > Отправлено с моего устройства Huawei > > > Исходное сообщение > Тема: curl-library Digest, Vol 164, Issue 28 > От: curl-library-requ...@cool.haxx.se > Кому: curl-library@cool.haxx.se > Копия: > > > Send curl-library mailing list submissions to > curl-library@cool.haxx.se > > To subscribe or unsubscribe via the World Wide Web, visit > https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-library > or, via email, send a message with subject or body 'help' to > curl-library-requ...@cool.haxx.se > > You can reach the person managing the list at > curl-library-ow...@cool.haxx.se > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of curl-library digest..." > > > Today's Topics: > > 1. Libcurl (Татьяна Комиссарова) > 2. Re: Libcurl (Igor Korot) > 3. Re: Libcurl (Daniel Stenberg) > 4. Re: Ranged PUTs, Content-Range, and Content-Length (Ray Satiro) > > > -- > > Message: 1 > Date: Mon, 29 Apr 2019 21:36:12 +0300 > From: Татьяна Комиссарова > To: "curl-library@cool.haxx.se" > Subject: Libcurl > Message-ID: > <-k48tm4d8k49k-m0tv6-kary7zryz1mo-9ta0oohgydnz-8a7k5sfsgyn3-hfjvfk-z1wb7q71ro6bakz9m0x28k24-r22jdxmpc4c2-jonqk8mqb9edx8tuuj-b6x7sv-nqiqsv-5z39vi99rw2po5an6k.1556562972...@email.android.com> > > Content-Type: text/plain; charset=utf-8 > > > Hi. Help, please, to collect Curl library. I downloaded the latest version, > but I do not know what to do next. Thank you for help > > > > -- > > Message: 2 > Date: Mon, 29 Apr 2019 16:09:53 -0500 > From: Igor Korot > To: libcurl development > Cc: Татьяна Комиссарова > Subject: Re: Libcurl > Message-ID: > > Content-Type: text/plain; charset="UTF-8" > > Hi, > > On Mon, Apr 29, 2019 at 2:54 PM Татьяна Комиссарова via curl-library > wrote: > > > > > > Hi. Help, please, to collect Curl library. I downloaded the latest version, > > but I do not know what to do next. Thank you for help > > What is you task? > What are you suppose to do? > > Thank you. > > > > > --- > > Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library > > Etiquette: https://curl.haxx.se/mail/etiquette.html > > > > -- > > Message: 3 > Date: Mon, 29 Apr 2019 23:12:31 +0200 (CEST) > From: Daniel Stenberg > To: Татьяна Комиссарова via curl-library > > Cc: Татьяна Комиссарова > Subject: Re: Libcurl > Message-ID: > Content-Type: text/plain; charset="utf-8"; Format="flowed" > > On Mon, 29 Apr 2019, Татьяна Комиссарова via curl-library wrote: > > > Hi. Help, please, to collect Curl library. I downloaded the latest version, > > but I do not know what to do next. Thank you for help > > You need to explain more what exactly you did and what you want! > > You downloaded what? The source code and now you want to build and install it? > > Or did you download a package/pre-built binary and have a problem to install > it? > > Which operating system are you working with? > > For a "getting started" guide on libcurl basics, I think everything curl's > chapter here is a good start: https://ec.haxx.se/libcurl.html > > -- > > / daniel.haxx.se > > -- > > Message: 4 > Date: Tue, 30 Apr 2019 03:21:28 -0400 > From: Ray Satiro > To: curl-library@cool.haxx.se > Subject: Re: Ranged PUTs, Content-Range, and Content-Length > Message-ID: > Content-Type: text/plain; charset="utf-8" > > On 4/28/2019 9:47 PM, Christopher Head via curl-library wrote: > > On Sun, 28 Apr 2019 16:57:39 -0400 > > Ray Satiro via curl-library wrote: > > > >> That's not allowed. To PUT is to completely replace a resource. > > Then it seems that upload resuming, which libcurl does support, ought > > to be banned, too, oughtn’t it? After all, using Content-Range to > > resume an interrupted upload is modifying the existing resource by > > appending more bytes on the end, not replacing a resource wholesale. > > Yet upload resuming using Content-Range seems not to be all that > > uncommon (at least, searching this list’s archives showed a few results > > of people doing this in the past, and CURLOPT_RESUME_FROM does apply to > > PUTs’ request bodies). > > > > In my defense, I’m not the one who decided to use PUT this way. Amazon > > did [1], and I’m just following their rules. > > > > If this is sufficiently weird, I certainly don’t mind using > > CURLOPT_HTTPHEADER. I just wanted to check if I was missing something > > that would allow this to be done in a nicer way. > > > > [1] > >
Re: curl-library Digest, Vol 164, Issue 28
I want to use Curl in a C++ program in Microsoft Visual Studio.Отправлено с моего устройства Huawei Исходное сообщение Тема: curl-library Digest, Vol 164, Issue 28От: curl-library-requ...@cool.haxx.seКому: curl-library@cool.haxx.seКопия: Send curl-library mailing list submissions to curl-library@cool.haxx.seTo subscribe or unsubscribe via the World Wide Web, visit https://cool.haxx.se/cgi-bin/mailman/listinfo/curl-libraryor, via email, send a message with subject or body 'help' to curl-library-requ...@cool.haxx.seYou can reach the person managing the list at curl-library-ow...@cool.haxx.seWhen replying, please edit your Subject line so it is more specificthan "Re: Contents of curl-library digest..."Today's Topics: 1. Libcurl (Татьяна Комиссарова) 2. Re: Libcurl (Igor Korot) 3. Re: Libcurl (Daniel Stenberg) 4. Re: Ranged PUTs, Content-Range, and Content-Length (Ray Satiro)--Message: 1Date: Mon, 29 Apr 2019 21:36:12 +0300From: Татьяна Комиссарова To: "curl-library@cool.haxx.se" Subject: LibcurlMessage-ID: <-k48tm4d8k49k-m0tv6-kary7zryz1mo-9ta0oohgydnz-8a7k5sfsgyn3-hfjvfk-z1wb7q71ro6bakz9m0x28k24-r22jdxmpc4c2-jonqk8mqb9edx8tuuj-b6x7sv-nqiqsv-5z39vi99rw2po5an6k.1556562972...@email.android.com> Content-Type: text/plain; charset=utf-8Hi. Help, please, to collect Curl library. I downloaded the latest version, but I do not know what to do next. Thank you for help--Message: 2Date: Mon, 29 Apr 2019 16:09:53 -0500From: Igor Korot To: libcurl development Cc: Татьяна Комиссарова Subject: Re: LibcurlMessage-ID: Content-Type: text/plain; charset="UTF-8"Hi,On Mon, Apr 29, 2019 at 2:54 PM Татьяна Комиссарова via curl-library wrote:>>> Hi. Help, please, to collect Curl library. I downloaded the latest version, but I do not know what to do next. Thank you for helpWhat is you task?What are you suppose to do?Thank you.>> ---> Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library> Etiquette: https://curl.haxx.se/mail/etiquette.html--Message: 3Date: Mon, 29 Apr 2019 23:12:31 +0200 (CEST)From: Daniel Stenberg To: Татьяна Комиссарова via curl-library Cc: Татьяна Комиссарова Subject: Re: LibcurlMessage-ID: Content-Type: text/plain; charset="utf-8"; Format="flowed"On Mon, 29 Apr 2019, Татьяна Комиссарова via curl-library wrote:> Hi. Help, please, to collect Curl library. I downloaded the latest version, > but I do not know what to do next. Thank you for helpYou need to explain more what exactly you did and what you want!You downloaded what? The source code and now you want to build and install it?Or did you download a package/pre-built binary and have a problem to install it?Which operating system are you working with?For a "getting started" guide on libcurl basics, I think everything curl's chapter here is a good start: https://ec.haxx.se/libcurl.html-- / daniel.haxx.se--Message: 4Date: Tue, 30 Apr 2019 03:21:28 -0400From: Ray Satiro To: curl-library@cool.haxx.seSubject: Re: Ranged PUTs, Content-Range, and Content-LengthMessage-ID: Content-Type: text/plain; charset="utf-8"On 4/28/2019 9:47 PM, Christopher Head via curl-library wrote:> On Sun, 28 Apr 2019 16:57:39 -0400> Ray Satiro via curl-library wrote:>>> That's not allowed. To PUT is to completely replace a resource.> Then it seems that upload resuming, which libcurl does support, ought> to be banned, too, oughtn’t it? After all, using Content-Range to> resume an interrupted upload is modifying the existing resource by> appending more bytes on the end, not replacing a resource wholesale.> Yet upload resuming using Content-Range seems not to be all that> uncommon (at least, searching this list’s archives showed a few results> of people doing this in the past, and CURLOPT_RESUME_FROM does apply to> PUTs’ request bodies).>> In my defense, I’m not the one who decided to use PUT this way. Amazon> did [1], and I’m just following their rules.>> If this is sufficiently weird, I certainly don’t mind using> CURLOPT_HTTPHEADER. I just wanted to check if I was missing something> that would allow this to be done in a nicer way.>> [1]> https://docs.aws.amazon.com/amazonglacier/latest/dev/api-upload-part.htmlCURLOPT_RANGE specifically as far as I know is only supposed to be usedfor download, not upload (can anyone confirm?), which would explain whatyou observed [1]. Anyway, I think what Amazon is doing is unusual andyou'd have to use CURLOPT_READFUNCTION and CURLOPT_SEEKFUNCTION (addingin your offset) and set Content-Range and amazon specific headers yourself.[1]: https://curl.haxx.se/mail/lib-2019-04/0075.html-- next part --An HTML attachment was scrubbed...URL: --Subject: Digest Footer___curl-library mailing
Re: Ranged PUTs, Content-Range, and Content-Length
On Tue, 30 Apr 2019, Ray Satiro via curl-library wrote: CURLOPT_RANGE specifically as far as I know is only supposed to be used for download, not upload (can anyone confirm?), This is correct. There's actually no standard way to do ranged "uploads" for HTTP, just various more or less working hacks. PATCH (RFC 5789) was the fix for that. -- / daniel.haxx.se --- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.html
Re: Ranged PUTs, Content-Range, and Content-Length
On 4/28/2019 9:47 PM, Christopher Head via curl-library wrote: > On Sun, 28 Apr 2019 16:57:39 -0400 > Ray Satiro via curl-library wrote: > >> That's not allowed. To PUT is to completely replace a resource. > Then it seems that upload resuming, which libcurl does support, ought > to be banned, too, oughtn’t it? After all, using Content-Range to > resume an interrupted upload is modifying the existing resource by > appending more bytes on the end, not replacing a resource wholesale. > Yet upload resuming using Content-Range seems not to be all that > uncommon (at least, searching this list’s archives showed a few results > of people doing this in the past, and CURLOPT_RESUME_FROM does apply to > PUTs’ request bodies). > > In my defense, I’m not the one who decided to use PUT this way. Amazon > did [1], and I’m just following their rules. > > If this is sufficiently weird, I certainly don’t mind using > CURLOPT_HTTPHEADER. I just wanted to check if I was missing something > that would allow this to be done in a nicer way. > > [1] > https://docs.aws.amazon.com/amazonglacier/latest/dev/api-upload-part.html CURLOPT_RANGE specifically as far as I know is only supposed to be used for download, not upload (can anyone confirm?), which would explain what you observed [1]. Anyway, I think what Amazon is doing is unusual and you'd have to use CURLOPT_READFUNCTION and CURLOPT_SEEKFUNCTION (adding in your offset) and set Content-Range and amazon specific headers yourself. [1]: https://curl.haxx.se/mail/lib-2019-04/0075.html --- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.html