Back to Alamofire

ParameterEncoding

docs/Protocols/ParameterEncoding.html

5.12.0851 B
Original Source

ParameterEncoding

public protocol ParameterEncoding : Sendable

A type used to define how a set of parameters are applied to a URLRequest.

`

                encode(_:with:)
                `

Creates a URLRequest by encoding parameters and applying them on the passed request.

Throws

Any Error produced during parameter encoding.

Declaration

Swift

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

Parameters

| urlRequest |

URLRequestConvertible value onto which parameters will be encoded.

| | parameters |

Parameters to encode onto the request.

|

Return Value

The encoded URLRequest.