URLRequest
extension URLRequest: URLRequestConvertible
                - 
                  
                  
Returns
self.Declaration
Swift
public func asURLRequest() throws -> URLRequest 
- 
                  
                  
Creates a
URLRequestinstance with the specifiedurl,method, andheaders.Declaration
Swift
public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throwsParameters
urlA
URLConvertiblevalue.methodAn
HTTPMethod.headersThe
HTTPHeaders,nilby default. - 
                  
                  
Creates a
URLRequestinstance with the specifiedurl,method,headers,parametersandmultipart attachments.Declaration
Swift
public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil, parameters: Parameters?, multipartAttachments: MultipartAttachments? = nil, encoding: ParameterEncoding = .urlEncodedForm) throwsParameters
urlA
URLConvertiblevalue.methodAn
HTTPMethod.headersThe
HTTPHeaders,nilby default.parametersA
ParametersvaluemultipartAttachmentsAn array of
URLs of the attachments.encodingThe parameter encoding type to use.
 - 
                  
                  
Encodes parameters and applies them to the
URLRequest.Throws
AnErrorif the encoding process encounters an error.Declaration
Swift
public mutating func encode(with parameters: Parameters?, encoding: ParameterEncoding = .urlEncodedForm) throwsParameters
parametersThe
Parametersto apply.encodingThe parameter encoding type to use.
 - 
                  
                  
Encodes parameters by applying them to an existing
URLRequest.Throws
AnErrorif the encoding process encounters an error.Declaration
Swift
public static func encode(_ urlRequest: inout URLRequest, with parameters: Parameters?, encoding: ParameterEncoding = .urlEncodedForm) throwsParameters
urlRequestThe
URLRequestto have parameters applied.parametersThe
Parametersto apply.encodingThe parameter encoding type to use.
 
        URLRequest Extension Reference