CFNetwork and HTTP/2

Hi,


I understand that NSURLSession from iOS 9 automatically handles HTTP/2 without any user interaction.

Is the same correct using CFNetwork (CFHTTP for example)? Or I need to handle the whole "upgrade" flow?


Thanks,

Israel

Accepted Answer

Is the same correct using CFNetwork (CFHTTP for example)?

No.

To be clear, both NSURLConnection and CFHTTPStream are now formally deprecated and, while we don't plan to remove those APIs any time soon, we also don't plan to add any new features to them either.

You should adopt NSURLSession.

If you can't adopt NSURLSession due to some deficiency in the API or implementation, please file a bug report describing the problem, and then post the bug number here just for the record.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Is there a C library from Apple that is not deprecated that we can use to get HTTP 2 functionality?

CFNetwork and HTTP/2
 
 
Q