PropertyListEncoding

public struct PropertyListEncoding: 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.

  • Returns a default PropertyListEncoding instance.

    Declaration

    Swift

    public static var `default`: PropertyListEncoding
  • xml

    Returns a PropertyListEncoding instance with xml formatting and default writing options.

    Declaration

    Swift

    public static var xml: PropertyListEncoding
  • Returns a PropertyListEncoding instance with binary formatting and default writing options.

    Declaration

    Swift

    public static var binary: PropertyListEncoding
  • The property list serialization format.

    Declaration

    Swift

    public let format: PropertyListSerialization.PropertyListFormat
  • The options for writing the parameters as plist data.

    Declaration

    Swift

    public let options: PropertyListSerialization.WriteOptions
  • Creates a PropertyListEncoding instance using the specified format and options.

    Declaration

    Swift

    public init(
            format: PropertyListSerialization.PropertyListFormat = .xml,
            options: PropertyListSerialization.WriteOptions = 0)
  • Creates a URL request by encoding parameters and applying them onto an existing request.

    Throws

    An Error if the encoding process encounters an error.

    Declaration

    Swift

    public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest