HTTPRequest
public struct HTTPRequest
Represents a lower-level HTTP request.
-
The underlaying
URLRequestDeclaration
Swift
public let urlRequest: URLRequest -
A URL to a file to be used as a streamed request body. If
fileURLis notnil,urlRequest.httpBodyandurlRequest.httpBodyStreammust benil.Declaration
Swift
public let fileUrl: URL? -
Creates a new request from the given
URLRequestand 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
URLRequestDeclaration
Swift
public init(urlRequest: URLRequest) -
Creates a new streamed request from the given
URLRequestand file URLDeclaration
Swift
public init(urlRequest: URLRequest, fileUrl: URL) -
Creates a new streamed request from the given
URLRequestandMultipartFormData. 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
HTTPRequest Structure Reference