• 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: Setting the NSURLDownload user agent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting the NSURLDownload user agent


  • Subject: Re: Setting the NSURLDownload user agent
  • From: Nick Beadman <email@hidden>
  • Date: Mon, 20 Apr 2015 11:37:52 -0700

Submitted radar://20619548 asking for a method to get the default user-agent string from NSURLRequest.

As for why I am using NSURLDownload rather than NSURLSession, it is quite simple I have to support OS X 10.8 and NSURLSession didn't appear until 10.9.

Does any one have any idea how I would write code to get the CFNetwork and Darwin versions? The only CF version number I have found is kCFCoreFoundationVersionNumber which isn't what I am looking for.

Thanks,
Nick

On Mon, Apr 20, 2015 at 2:14 AM, Quinn "The Eskimo!" <email@hidden> wrote:

On 17 Apr 2015, at 22:23, Nick Beadman <email@hidden> wrote:

> When setting the user-agent this way it contains exactly what you set and nothing else. I would like to continue to append the CFNetwork and Darwin version. Any one know how to do that?

There's no easy way to do that: setting the user agent string is an all or nothing thing.  You could write code to get the CFNetwork and Darwin versions and mimic what CFNetwork is doing, but that's not very sustainable.

Feel free to file a bug requesting a better option for this.

<https://developer.apple.com/bug-reporting/>

Please post your bug number, just for the record.

                   *                   *                   *

Also, why are you using NSURLDownload and not NSURLSession download tasks?  The latter is strongly recommended these days.

And if you do file a bug, make sure to file it against NSURLSession, not NSURLDownload, but NSURLSession is The Future™.

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Setting the NSURLDownload user agent
      • From: "Quinn \"The Eskimo!\"" <email@hidden>
    • Re: Setting the NSURLDownload user agent
      • From: Jens Alfke <email@hidden>
References: 
 >Setting the NSURLDownload user agent (From: Nick Beadman <email@hidden>)
 >Re: Setting the NSURLDownload user agent (From: "Quinn \"The Eskimo!\"" <email@hidden>)

  • Prev by Date: Re: Questions on when credentials are used in NSURLSessionDownloadTask
  • Next by Date: Re: Setting the NSURLDownload user agent
  • Previous by thread: Re: Setting the NSURLDownload user agent
  • Next by thread: Re: Setting the NSURLDownload user agent
  • Index(es):
    • Date
    • Thread