NilEncoding

public struct NilEncoding

Encoding to use for nil values.

  • Encodes nil by dropping the entire key / value pair.

    Declaration

    Swift

    public static let dropKey: URLEncodedFormEncoder.NilEncoding
  • Encodes nil by dropping only the value. e.g. value1=one&nilValue=&value2=two.

    Declaration

    Swift

    public static let dropValue: URLEncodedFormEncoder.NilEncoding
  • Encodes nil as null.

    Declaration

    Swift

    public static let null: URLEncodedFormEncoder.NilEncoding
  • Creates an instance with the encoding closure called for nil values.

    Declaration

    Swift

    public init(encoding: @escaping () -> String?)

    Parameters

    encoding

    Closure used to perform the encoding.