Re: How does Cocoa identify itself to a web server?
Re: How does Cocoa identify itself to a web server?
- Subject: Re: How does Cocoa identify itself to a web server?
- From: Jeff LaMarche <email@hidden>
- Date: Tue, 8 Nov 2005 17:05:03 -0500
On Nov 8, 2005, at 4:13 PM, Peter Schols wrote:
When using the URL methods in Foundation, (such as
initWithContentsOfURL:encoding:error in NSString), how does
Foundation identify itself to the web server?
(in case the URL points to an HTTP server, for example).
Are you asking what User Agent string it gives to the web server?
I think it gives something like:
CFNetwork/1.1
when using either the core foundation functions or the Cocoa
initWithContentsOfURL: convenience methods. I'm not 100% sure that it
uses that for the latter, but I know it does for the former and
suspect it does with the latter. I don't believe there is a way to
change or override the user-agent string when using these functions
and methods.
If you're using WebKit, it's got its own User-Agent string which is
different from what I stated above, although you can override it.
You can also specify your own User-Agent string if you're using
NSURLRequest by using the setValue:forHTTPHeaderField: method using
an HTTP Header field of @"User-Agent".
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden