HTTP chunked transfer encoding implementation
HTTP chunked transfer encoding implementation
- Subject: HTTP chunked transfer encoding implementation
- From: "Roman Kishchenko" <email@hidden>
- Date: Wed, 10 Sep 2008 11:15:08 -0400
Hi,
I have the following use case. The client is making an HTTP POST request and
would like to use chunked transfer encoding to send chunks of binary data to
the server as they are generated. In particular, the client would like to
avoid accumulating the data in its entirety before sending it to the server
but rather, as mentioned above, send it in chunks.
Having looked at NSMutableURLRequest and related classes,
CFReadStreamCreateForStreamedHTTPRequest, and streams in general, I have
concluded that there currently is no API that would support above use case
out-of-the-box. The primary reason is that input/read stream implementations
in both at Foundation and Core Foundation levels assume that the data in its
entirety is available for read before read/input stream is created and the
request is made.
So, the solution to the problem seems to implement HTTP protocol from
scratch using sockets and streams and handle described above chunk send
semantics there. Before embarking on this interesting programming exercise,
I am wondering if there is no simpler way of doing this that I may have
missed. Please, let me know if it is so.
Thanks!
Roman Kishchenko
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden