Re: HEAD request using NSURLConnection
Re: HEAD request using NSURLConnection
- Subject: Re: HEAD request using NSURLConnection
- From: Daniel Miao <email@hidden>
- Date: Fri, 23 Jan 2004 03:08:12 -0500
Hi Daryn,
Thanks a lot for your suggestion. The HEAD request that is sent does,
in fact, include "Connection: keep-alive". I took a look at the HTTP
RFC and it seems that setting it to "close" may be the solution.
Problem now is that when I try to invoke [request setValue@"close"
forHTTPHeaderField:@"Connection"], it does not actually change the
value of the "Connection" field. When I try setting the values of
other header fields for testing, the other ones do change, but it seems
that the Connection header is forced to "keep-alive".
Any suggestions regarding this issue?
Thanks!
Daniel
On Jan 23, 2004, at 1:51 AM, Daryn wrote:
Solely based on your symptoms, I'd bet a doughnut that if you sniffed
the payload of the requests, NSURL is using "Connection: keep-alive".
NSURL is probably too ignorant to properly handle HEAD request. It's
waiting for the specified Content-length of bytes that are not going
to be returned. Stalemate results until either NSURL times out, or
the remote server closes the connection due to inactivity.
Try invoking:
[request setValue:@"close" forHTTPHeaderField:@"Connection"]
I hope that helps!
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.