开发者

CFHTTPMessageCopyBody returns the header

开发者 https://www.devze.com 2023-03-09 22:18 出处:网络
I am testing the product on the new osx 10.7 preview. First, we found a开发者_开发知识库 problem CFHTTPMessageCopyBody is not happy with the message which header is not complete. To make 10.7 happy, w

I am testing the product on the new osx 10.7 preview. First, we found a开发者_开发知识库 problem CFHTTPMessageCopyBody is not happy with the message which header is not complete. To make 10.7 happy, we basically use the approach:

create an empty message, call CFHTTPMessageAppendBytes append the response header, call CFHTTPMessageAppendBytes append the http body, call CFHTTPMessageCopyBody to get the body without header.

But, to our surprise, CFHTTPMessageCopyBody actually returns the header after the body. The problem happens to all 10.5, 10.6 and 10.7 platform.

Thanks in advance.

Max


It turns out it was my fault. I accidentally append headers to the message after the header is complete. Thus, the new header becomes a part of body.

0

精彩评论

暂无评论...
验证码 换一张
取 消