10

I saw that URLSession supports HTTP 1.1 and HTTP 2 (URLSession supports the HTTP/1.1 and HTTP/2 protocols).

How can I enforce URLSession to use HTTP1.1?

swalkner
  • 16,679
  • 31
  • 123
  • 210

2 Answers2

8

This is not something determined by the URLSession. It is determined by the server it connects to.

Read more on that here... https://forums.developer.apple.com/thread/94907

Fogmeister
  • 76,236
  • 42
  • 207
  • 306
2

Not exactly, there is ALPN negotiation to decide if HTTP/2. If client does not send ALPN, then server should not use HTTP/2.

lu fei
  • 21
  • 1