RequestResponse

public struct RequestResponse<Body>
extension RequestResponse: Equatable where Body: Equatable
extension RequestResponse: Hashable where Body: Hashable

A network response generated by a Requestable

Factories

  • Undocumented

    Declaration

    Swift

    public static var empty: `Self` { get }

Initializers

  • Create a RequestResponse

    Declaration

    Swift

    public init(url: URL?,
                headers: RequestHeaders?,
                statusCode: Int?,
                body: Body?)

    Parameters

    url

    The URL that generated the response

    headers

    The response headers

    statusCode

    The response status code

    body

    The response body

API

  • url

    The URL that generated the response

    Declaration

    Swift

    public var url: URL?
  • The response headers

    Declaration

    Swift

    public var headers: RequestHeaders?
  • The response status code

    Declaration

    Swift

    public var statusCode: Int?
  • The response

    Declaration

    Swift

    public var body: Body?

Available where Body: Equatable

  • Declaration

    Swift

    public static func == (lhs: RequestResponse<Body>, rhs: RequestResponse<Body>) -> Bool

Available where Body: Hashable

  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)