• 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
Re: Content Length always 0
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Content Length always 0


  • Subject: Re: Content Length always 0
  • From: Alexey Proskuryakov <email@hidden>
  • Date: Wed, 23 Nov 2005 12:09:23 +0300
  • Thread-topic: Content Length always 0

On 23.11.2005 07:10, "Brad Soe" <email@hidden> wrote:

> 'Content-Length' header is always set to 0, even though I try to set it to the
> value using CFHTTPMessageSetHeaderFieldValue. It could be that I am doing
> something wrong, but the Apple docs are not that great. Am I supposed to use
> CFHTTPMessageSetBody?

  Yes, for a simple request, you can just use CFHTTPMessageSetBody(), and it
will set the Content-Length automatically. CFHTTPMessageSetHeaderFieldValue
with Content-Length is needed for streamed requests
(CFReadStreamCreateForStreamedHTTPRequest() etc).

> The current code just creates the message, adds the headers and uses
> CFHTTPMessageAppendBytes to add the body of the post

  CFHTTPMessageAppendBytes() is a completely different function - just read
its description in the docs
<http://developer.apple.com/documentation/Networking/Conceptual/CFNetwork/Ch
apter_3/chapter_4.1_section_32.html>.

- WBR, Alexey Proskuryakov


 _______________________________________________
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

References: 
 >Content Length always 0 (From: Brad Soe <email@hidden>)

  • Prev by Date: Content Length always 0
  • Next by Date: Socket problem using linux as server
  • Previous by thread: Content Length always 0
  • Next by thread: Re: Content Length always 0
  • Index(es):
    • Date
    • Thread