URLRequest
extension URLRequest: URLRequestConvertible
-
Returns
self
.Declaration
Swift
public func asURLRequest() throws -> URLRequest
-
Struct representing a multipart attachment to a multipart form data request
See moreDeclaration
Swift
public struct MultipartAttachment : Equatable
-
A typealias for an array of
MultipartAttachment
Declaration
Swift
public typealias MultipartAttachments = [MultipartAttachment]
-
Creates a
URLRequest
instance with the specifiedurl
,method
, andheaders
.Declaration
Swift
public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throws
Parameters
url
A
URLConvertible
value.method
An
HTTPMethod
.headers
The
HTTPHeaders
,nil
by default. -
Creates a
URLRequest
instance with the specifiedurl
,method
,headers
,parameters
andmultipart attachments
.Declaration
Swift
public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil, parameters: Parameters?, multipartAttachments: MultipartAttachments? = nil) throws
Parameters
url
A
URLConvertible
value.method
An
HTTPMethod
.headers
The
HTTPHeaders
,nil
by default.parameters
A
Parameters
valuemultipartAttachments
An array of
URL
s of the attachments. -
Encodes parameters and applies them to the
URLRequest
.Throws
AnError
if the encoding process encounters an error.Declaration
Swift
public mutating func encode(with parameters: Parameters?) throws
Parameters
parameters
The
Parameters
to apply. -
Encodes parameters by applying them to an existing
URLRequest
.Throws
AnError
if the encoding process encounters an error.Declaration
Swift
public static func encode(_ urlRequest: inout URLRequest, with parameters: Parameters?) throws
Parameters
urlRequest
The
URLRequest
to have parameters applied.parameters
The
Parameters
to apply.