All HTTP header fields of the response.
- iOS 2.0+
- macOS 10.2+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
A dictionary containing all the HTTP header fields received as part of the server’s response. By examining this dictionary clients can see the “raw” header information returned by the HTTP server.
The keys in this dictionary are the header field names, as received from the server. See RFC 2616 for a list of commonly used HTTP header fields.
HTTP headers are case insensitive. To simplify your code, certain header field names are canonicalized into their standard form. For example, if the server sends a
content-length header, it is automatically adjusted to be
The returned dictionary of headers is configured to be case-preserving during the set operation (unless the key already exists with a different case), and case-insensitive when looking up keys.
For example, if you set the header
X-foo, and then later set the header
X-Foo, the dictionary’s key will be
X-foo, but the value will taken from the
Prior to OS X v10.7 and iOS 5, canonicalization occurred for all header fields. The case-preserving dictionary was first introduced in OS X v10.7.2 and iOS 5.