HTTPBodyStream without chunked encoding?
HTTPBodyStream without chunked encoding?
- Subject: HTTPBodyStream without chunked encoding?
- From: Jens Alfke <email@hidden>
- Date: Sun, 05 Feb 2012 12:30:34 -0800
I’m setting NSURLRequest’s HTTPBodyStream so I can stream the body of a PUT request (see previous thread). Unfortunately the server I’m uploading to barfs on the request, and its error message is pretty opaque. As far as I can tell from packet-sniffing, what I’m sending is correct. And if I modify my code to slurp the stream into a single NSData and set that as the HTTPBody instead, the server accepts it fine. So my conclusion is that for some reason the server is unhappy with the chunked transfer encoding that’s sued when CFNetwork sends the streamed body.
So I’m wondering if there’s any way to get CFNetwork to send the request un-chunked. Of course it has to if the stream's length isn’t known, but I already know how long the stream is going to be, so could I set the Content-Length myself or something?
—Jens
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden