HTTPRequest
public struct HTTPRequest
Represents a lower-level HTTP request.
-
The underlaying
URLRequest
Declaration
Swift
public let urlRequest: URLRequest
-
A URL to a file to be used as a streamed request body. If
fileURL
is notnil
,urlRequest.httpBody
andurlRequest.httpBodyStream
must benil
.Declaration
Swift
public let fileUrl: URL?
-
Creates a new request from the given
URLRequest
and file URL. The request will be streamed if fileURL is notnil
.Declaration
Swift
public init(urlRequest: URLRequest, fileUrl: URL?)
-
Creates a new non-streamed request from the given
URLRequest
Declaration
Swift
public init(urlRequest: URLRequest)
-
Creates a new streamed request from the given
URLRequest
and file URLDeclaration
Swift
public init(urlRequest: URLRequest, fileUrl: URL)
-
Creates a new streamed request from the given
URLRequest
andMultipartFormData
. This initializer creates a temporary file to store the given request body and callsinit(urlRequest:fileUrl:)
.Declaration
Swift
public init(urlRequest: URLRequest, formData: MultipartFormData) throws