Structures

The following structures are available globally.

  • An order-preserving and case-insensitive representation of HTTP headers.

    See more

    Declaration

    Swift

    public struct HTTPHeaders
  • A representation of a single HTTP header’s name / value pair.

    See more

    Declaration

    Swift

    public struct HTTPHeader : Hashable
  • Creates a url-encoded query string to be set as or appended to any existing URL query string or set as the HTTP body of the URL request. Whether the query string is set or appended to any existing URL query string or set as the HTTP body depends on the destination of the encoding.

    The Content-Type HTTP header field of an encoded request with HTTP body is set to application/x-www-form-urlencoded; charset=utf-8.

    There is no published specification for how to encode collection types. By default the convention of appending [] to the key for array values (foo[]=1&foo[]=2), and appending the key surrounded by square brackets for nested dictionary values (foo[bar]=baz) is used. Optionally, ArrayEncoding can be used to omit the square brackets appended to array keys.

    BoolEncoding can be used to configure how boolean values are encoded. The default behavior is to encode true as 1 and false as 0.

    See more

    Declaration

    Swift

    public struct URLEncoding : ParameterEncoding
  • Uses JSONSerialization to create a JSON representation of the parameters object, which is set as the body of the request. The Content-Type HTTP header field of an encoded request is set to application/json.

    See more

    Declaration

    Swift

    public struct JSONEncoding : ParameterEncoding
  • Redirector is a convenience RedirectHandler making it easy to follow, not follow, or modify a redirect.

    See more

    Declaration

    Swift

    public struct Redirector
  • Used to store all data associated with a serialized response of a download request.

    See more

    Declaration

    Swift

    public struct DownloadResponse<Success, Failure> where Failure : Error
  • Type representing an empty response. Use Empty.value to get the static instance.

    See more

    Declaration

    Swift

    public struct Empty : Decodable