Other Structs

The following structs are available globally.

  • Used to store all data associated with a serialized response of a data or upload request.

    See more

    Declaration

    Swift

    public struct DataResponse<Value>
  • 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. Since there is no published specification for how to encode collection types, 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).

    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
  • Uses PropertyListSerialization to create a plist representation of the parameters object, according to the associated format and write options values, which is set as the body of the request. The Content-Type HTTP header field of an encoded request is set to application/x-plist.

    See more

    Declaration

    Swift

    public struct PropertyListEncoding: ParameterEncoding