curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Ranged PUTs, Content-Range, and Content-Length

From: Ray Satiro <raysatiro_at_yahoo.com>
Date: Sun, 28 Apr 2019 16:57:39 -0400

On 4/28/2019 1:27 PM, Christopher Head via curl-library wrote:
> I’m trying to PUT a sub-interval of a file. In simple terms, for the
> sake of example, let’s say I have a 4-byte file and I want to PUT the
> middle two bytes.

That's not allowed. To PUT is to completely replace a resource. PATCH
[1] was created to modify an existing resource but the problem is race
conditions and support. In other words you go to modify a resource and
someone else could also be modifying the resource (solution If-Match I
think), or the server may not support it (check OPTIONS on the resource
for supported types). Though libcurl doesn't have native support for it,
you could probably build a custom request. I really don't know a lot
about it, hopefully others here know more. I'd read the RFC if you have
a chance it looks like a short read.

[1]: https://tools.ietf.org/html/rfc5789

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html

Received on 2019-04-28