URLEncodedFormParameterEncoder - SwiftDocOrg/Alamofire GitHub Wiki
URLEncodedFormParameterEncoder
A ParameterEncoder that encodes types as URL-encoded query strings to be set on the URL or as body data, depending
on the Destination set.
open class URLEncodedFormParameterEncoder:β ParameterEncoder
If no Content-Type header is already set on the provided URLRequests, it will be set to
application/x-www-form-urlencoded; charset=utf-8.
Encoding behavior can be customized by passing an instance of URLEncodedFormEncoder to the initializer.
Inheritance
Initializers
init(encoder:βdestination:β)
Creates an instance with the provided URLEncodedFormEncoder instance and Destination value.
public init(encoder:β URLEncodedFormEncoder = URLEncodedFormEncoder(), destination:β Destination = .methodDependent)
Parameters
- encoder:β The
URLEncodedFormEncoder.URLEncodedFormEncoder()by default. - destination:β The
Destination..methodDependentby default.
Properties
`default`
Returns an encoder with default parameters.
var `default`:β URLEncodedFormParameterEncoder
encoder
The URLEncodedFormEncoder to use.
let encoder:β URLEncodedFormEncoder
destination
The Destination for the URL-encoded string.
let destination:β Destination
Methods
encode(_:βinto:β)
open func encode<Parameters:β Encodable>(_ parameters:β Parameters?, into request:β URLRequest) throws -> URLRequest