Re: Content Length always 0
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