HTTP / 2 support for iOS 8
I asked the same question on the Apple Developers Forum and they gave a crystal clear answer:
HTTP / 2 support is part of iOS 9 and therefore will not be available on earlier OS versions.
https://forums.developer.apple.com/message/31667
But I'm worried about the behavior of iOS 8. I'm still confused about your actual question. I suspect you are talking about this case:
- you create an application using NSURLSession.
- you are deploying a server that supports HTTP / 2
- on iOS 9, this will talk to your server over HTTP / 2
- on iOS 8, this will talk to your server over HTTP / 1.1 or SPDY
- on iOS 7, this will talk to your server over HTTP / 1.1
It really depends on your server. Ignoring iOS 8 and SPDY for now, consider the case of iOS 7. Here, iOS is just going to open a connection and send an HTTP command. What is the server in this case? It should handle it correctly, but iOS can't guarantee it.
OTOH, if I read your original question literally, you seem to be asking about this case:
- you create an application using NSURLSession.
- you are deploying a server that supports HTTP / 2
- on iOS 9, this will talk to your server over HTTP / 2
- on iOS 8, will it send HTTP / 2 requests?
The answer is no: HTTP / 2 support is part of iOS 9 and therefore won't be available on earlier versions of the OS. OTOH, iOS 8 does have SPDY support. See WWDC 2014 Session 707 What's New in Foundation Network for details.
source to share