Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

ParameterEncoder

mattt edited this page Sep 18, 2020 · 2 revisions

ParameterEncoder

A type that can encode any Encodable type into a URLRequest.

public protocol ParameterEncoder

Requirements

encode(_:​into:​)

Encode the provided Encodable parameters into request.

func encode<Parameters:​ Encodable>(_ parameters:​ Parameters?, into request:​ URLRequest) throws -> URLRequest

Parameters

  • parameters:​ The Encodable parameter value.
  • request:​ The URLRequest into which to encode the parameters.

Throws

An Error when encoding fails. For Alamofire provided encoders, this will be an instance of AFError.parameterEncoderFailed with an associated ParameterEncoderFailureReason.

Returns

A URLRequest with the result of the encoding.

Types
Protocols
Global Typealiases
Clone this wiki locally