Initializerswift-http-types 1.3.1HTTPTypes
init(from:)
HTTPResponse.swift:284init(from decoder: Decoder) throws
init(from decoder: Decoder) throws
import HTTPTypes
A set of version-independent HTTP currency types.
struct HTTPResponse
An HTTP response message consisting of the “:status” pseudo header field and header fields.
protocol Decoder
A type that can decode values from a native format into in-memory representations.
init(parsed fields: [HTTPField]) throws
Create an HTTP response with an array of parsed HTTPField
. The fields must include the necessary response pseudo header fields.
init(status: Status, headerFields: HTTPFields = [:])
Create an HTTP response with a status and header fields.
var debugDescription: String { get }
var headerFields: HTTPFields
The response header fields.
var pseudoHeaderFields: PseudoHeaderFields
The pseudo header fields.
var status: Status { get set }
The status of the response.
static func == (lhs: HTTPResponse, rhs: HTTPResponse) -> Bool
func encode(to encoder: Encoder) throws
func hash(into hasher: inout Hasher)
struct PseudoHeaderFields
The pseudo header fields of a response.
struct Status
The response status consisting of a 3-digit status code and a reason phrase. The reason phrase is ignored by modern HTTP versions.