HTTPHeaders
public struct HTTPHeaders
Representation of the HTTP headers associated with a HTTPRequest
or HTTPResponse
.
Headers are subscriptable using case-insensitive comparison or provide Name
constants. eg.
let contentLength = headers["content-length"]
or
let contentLength = headers[.contentLength]
-
Creates HTTP headers.
Declaration
Swift
public init(dictionaryLiteral: (Name, String)...)
-
Appends a header to the headers
Declaration
Swift
public mutating func append(_ literal: HTTPHeaders.Literal)
-
Replaces a header in the headers
Declaration
Swift
public mutating func replace(_ literal: HTTPHeaders.Literal)
-
Type used for the name of a HTTP header in the
See moreHTTPHeaders
storage.Declaration
Swift
public struct Name: Hashable, ExpressibleByStringLiteral, CustomStringConvertible