HTTPRequest
public protocol HTTPRequest
A protocol for defining a HTTP request.
-
Declaration
Swift
associatedtype ResponseObject -
Declaration
Swift
associatedtype ErrorObject : Error -
The base URL.
Declaration
Swift
var baseURL: URL { get } -
The URL path.
Declaration
Swift
var path: String { get } -
methodDefault implementationThe HTTP method used in the request.
Default Implementation
Declaration
Swift
var method: HTTPMethod { get } -
queryItemsDefault implementationAn array of query items to be appended to the URL path.
Default Implementation
Declaration
Swift
var queryItems: [URLQueryItem]? { get } -
headersDefault implementationDictionaryof headers.Default Implementation
Declaration
Swift
var headers: [String : String]? { get } -
timeoutDefault implementationA
TimeIntervalof when the request should timeout.Default Implementation
Declaration
Swift
var timeout: TimeInterval { get } -
A
Boolto indicate whether the request is authenticated or not.Declaration
Swift
var isAuthenticated: Bool { get } -
HTTP body of the request.
Declaration
Swift
var body: Data? { get set } -
Processes the response.
Declaration
Swift
func process(data: Data, response: URLResponse) throws -> ResponseObjectReturn Value
The response object
HTTPRequest Protocol Reference