twitter-archive / CocoaSPDY

SPDY for iOS and OS X
Apache License 2.0
2.39k stars 233 forks source link

why request header didn't contain Content-length field? #122

Closed dingjingpisces2015 closed 9 years ago

dingjingpisces2015 commented 9 years ago

I would like know why content-length field does't in the request header.

kgoodier commented 9 years ago

The v1.2 release (and v1.1) include code that will add a default Content-Length header in the request when either HTTPBody or SPDYBodyFile are set. The app will need to set it when an input stream is being used, however, and of course the app can always override the default added by CocoaSPDY.

See code block starting at https://github.com/twitter/CocoaSPDY/blob/master/SPDY/SPDYCanonicalRequest.m#L317 for the details.