Is CFHTTPMessage support http2?

I use the CFNetwork API to create httpmessage like bellow

CFHTTPMessageCreateRequest(CFAllocatorRef __nullable alloc, CFStringRef requestMethod, CFURLRef url, CFStringRef httpVersio

when I passed kCFHTTPVersion1_1 to the httpVersion param, it work fine. But not with kCFHTTPVersion2_0.


And then I found the document for the httpVersion param described as

The HTTP version for this message. Pass kCFHTTPVersion1_0 or kCFHTTPVersion1_1.


So, Is it the CFHTTPMessageCreateRequest api can not pass kCFHTTPVersion2_0?

CFHTTPMessage
is very much focused on HTTP 1.x. It does not support HTTP/2 in any way shape or form. Indeed, parsing and rendering HTTP/2 introduces complexities that just can’t be handled by the
CFHTTPMessage
API.

Why do you need this? HTTP/2 is quite complex, so it’s hard to imagine a situation where you’d have code to handle HTTP/2 that doesn’t also handle HTTP/2 message parsing and rendering.

Share and Enjoy

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

let myEmail = "eskimo" + "1" + "@apple.com"
Is CFHTTPMessage support http2?
 
 
Q