Re: HEAD request using NSURLConnection
Re: HEAD request using NSURLConnection
- Subject: Re: HEAD request using NSURLConnection
- From: Daryn <email@hidden>
- Date: Sat, 24 Jan 2004 14:00:07 -0600
Greeting Daniel,
If you were able to use my suggestion of changing the connection
header, it would have only been a solution is the sense that it worked
around a bug in NSURL's inability to handle HEAD requests properly. I
haven't worked much with NSURL, so I have no other suggestions than to
file a bug with Apple. Sorry.
On Jan 23, 2004, at 2:08 AM, Daniel Miao wrote:
>
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.
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.