• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
HTTPBodyStream without chunked encoding?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: HTTPBodyStream without chunked encoding?
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Exception using custom input stream for NSURLRequest
  • Next by Date: Re: Exception using custom input stream for NSURLRequest
  • Previous by thread: Re: Exception using custom input stream for NSURLRequest
  • Next by thread: Re: HTTPBodyStream without chunked encoding?
  • Index(es):
    • Date
    • Thread