Structure
HTTPResponse
public struct HTTPResponse: Equatable
A simplified model for HTTP responses.
Relationships
Conforms To
Equatable
Initializers
init(status:headers:body:)
public init(status: HTTPResponseStatus, headers: HTTPHeaders = [], body: HTTPBody? = nil)
Creates an instance of HTTPResponse.
Parameters
| Name | Type | Description |
|---|---|---|
| status | HTTPResponseStatus |
|
| headers | HTTPHeaders |
|
| body | HTTPBody? |
|
Properties
status
let status: HTTPResponseStatus
HTTP response status eg. 200 OK.
headers
let headers: HTTPHeaders
HTTP response headers eg. Content-Type: application/json.