Back to Alamofire

NilEncoding

docs/Classes/URLEncodedFormEncoder/NilEncoding.html

5.12.01.1 KB
Original Source

NilEncoding

public struct NilEncoding : Sendable

Encoding to use for nil values.

`

                dropKey
                `

Encodes nil by dropping the entire key / value pair.

Declaration

Swift

public static let dropKey: URLEncodedFormEncoder.NilEncoding

`

                dropValue
                `

Encodes nil by dropping only the value. e.g. value1=one&nilValue=&value2=two.

Declaration

Swift

public static let dropValue: URLEncodedFormEncoder.NilEncoding

`

                null
                `

Encodes nil as null.

Declaration

Swift

public static let null: URLEncodedFormEncoder.NilEncoding

`

                init(encoding:)
                `

Creates an instance with the encoding closure called for nil values.

Declaration

Swift

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

Parameters

| encoding |

Closure used to perform the encoding.

|