Request
open class Request
Represents Http request
-
Url of request
Declaration
Swift
public var url: URL
-
Http method
Declaration
Swift
public var method: Method
-
Request headers
Declaration
Swift
public var headers: [String : String]?
-
Request body
Declaration
Swift
public var body: Data?
-
Default request timeout
Declaration
Swift
public static let defaultTimeout: TimeInterval
-
Declaration
Swift
public enum Method : String
-
Initializer
Declaration
Swift
public init(url: URL, method: Method, headers: [String : String]? = nil, body: Data? = nil)
Parameters
url
Request url
method
Request method
headers
Request headers
body
Request body
-
Initializer from URLRequest
Throws
RequestError.urlRequestIsIncompleteOrInvalid if URLRequest is incomplete or invalidDeclaration
Swift
public init(urlRequest: URLRequest) throws
Parameters
urlRequest
URLRequest
-
Returns URLRequest created from this Request
Declaration
Swift
public func getNativeRequest() -> URLRequest
Return Value
URLRequest