RestResponse

public struct RestResponse<T>

Contains data associated with a finished network request, with T being the type of response we expect to receive.

  • The response host.

    Declaration

    Swift

    public var host: String
  • The HTTP status code.

    Declaration

    Swift

    public var status: HTTPResponseStatus
  • The HTTP headers.

    Declaration

    Swift

    public var headers: HTTPHeaders
  • The HTTP request that was sent to get this response.

    Declaration

    Swift

    public var request: HTTPClient.Request
  • The body of the response as the expected type.

    Declaration

    Swift

    public var body: T
  • The cookies from the response.

    Declaration

    Swift

    public var cookies: [HTTPClient.Cookie]