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
MultipartAttachmentDeclaration
Swift
public typealias MultipartAttachments = [MultipartAttachment] -
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) throwsParameters
urlA
URLConvertiblevalue.methodAn
HTTPMethod.headersThe
HTTPHeaders,nilby default.parametersA
ParametersvaluemultipartAttachmentsAn array of
URLs of the attachments. -
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?) throwsParameters
parametersThe
Parametersto apply. -
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?) throwsParameters
urlRequestThe
URLRequestto have parameters applied.parametersThe
Parametersto apply.
View on GitHub
URLRequest Extension Reference