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 not nil, urlRequest.httpBody and urlRequest.httpBodyStream must be nil.

    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 not nil.

    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 URL

    Declaration

    Swift

    public init(urlRequest: URLRequest, fileUrl: URL)
  • Creates a new streamed request from the given URLRequest and MultipartFormData. This initializer creates a temporary file to store the given request body and calls init(urlRequest:fileUrl:).

    Declaration

    Swift

    public init(urlRequest: URLRequest, formData: MultipartFormData) throws