• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How does Cocoa identify itself to a web server?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • [Solved] How does Cocoa identify itself to a web server?
      • From: Peter Schols <email@hidden>
References: 
 >Problems parsing plist files (From: Peter Schols <email@hidden>)
 >Re: Problems parsing plist files (From: Nicko van Someren <email@hidden>)
 >How does Cocoa identify itself to a web server? (From: Peter Schols <email@hidden>)

  • Prev by Date: Re: Any NSView (subclasss drawing) Layout Persistence Frameworks around?
  • Next by Date: Re: Processing multiple objects w/NSTasks efficiently?
  • Previous by thread: Re: How does Cocoa identify itself to a web server?
  • Next by thread: [Solved] How does Cocoa identify itself to a web server?
  • Index(es):
    • Date
    • Thread