-
Request HTTP method, defaults to
GET.Declaration
Swift
public let method: HTTPMethod -
Remote URL.
Declaration
Swift
public let url: URL -
Remote HTTP scheme, resolved from
URL.Declaration
Swift
public let scheme: String -
Remote host, resolved from
URL.Declaration
Swift
public let host: String -
Request custom HTTP Headers, defaults to no headers.
Declaration
Swift
public var headers: HTTPHeaders -
Request body, defaults to no body.
Declaration
Swift
public var body: Body? -
Request-specific TLS configuration, defaults to no request-specific TLS configuration.
Declaration
Swift
public var tlsConfiguration: TLSConfiguration? -
Create HTTP request.
Throws
invalidURLif URL cannot be parsed.emptySchemeif URL does not contain HTTP scheme.unsupportedSchemeif URL does contains unsupported HTTP scheme.emptyHostif URL does not contains a host.
Declaration
Swift
public init(url: String, method: HTTPMethod = .GET, headers: HTTPHeaders = HTTPHeaders(), body: Body? = nil) throwsParameters
urlRemote
URL.versionHTTP version.
methodHTTP method.
headersCustom HTTP headers.
bodyRequest body.
-
Create HTTP request.
Throws
invalidURLif URL cannot be parsed.emptySchemeif URL does not contain HTTP scheme.unsupportedSchemeif URL does contains unsupported HTTP scheme.emptyHostif URL does not contains a host.
Declaration
Swift
public init(url: String, method: HTTPMethod = .GET, headers: HTTPHeaders = HTTPHeaders(), body: Body? = nil, tlsConfiguration: TLSConfiguration?) throwsParameters
urlRemote
URL.versionHTTP version.
methodHTTP method.
headersCustom HTTP headers.
bodyRequest body.
tlsConfigurationRequest TLS configuration
-
Create an HTTP
Request.Throws
emptySchemeif URL does not contain HTTP scheme.unsupportedSchemeif URL does contains unsupported HTTP scheme.emptyHostif URL does not contains a host.missingSocketPathif URL does not contains a socketPath as an encoded host.
Declaration
Swift
public init(url: URL, method: HTTPMethod = .GET, headers: HTTPHeaders = HTTPHeaders(), body: Body? = nil) throwsParameters
urlRemote
URL.methodHTTP method.
headersCustom HTTP headers.
bodyRequest body.
-
Create an HTTP
Request.Throws
emptySchemeif URL does not contain HTTP scheme.unsupportedSchemeif URL does contains unsupported HTTP scheme.emptyHostif URL does not contains a host.missingSocketPathif URL does not contains a socketPath as an encoded host.
Declaration
Swift
public init(url: URL, method: HTTPMethod = .GET, headers: HTTPHeaders = HTTPHeaders(), body: Body? = nil, tlsConfiguration: TLSConfiguration?) throwsParameters
urlRemote
URL.methodHTTP method.
headersCustom HTTP headers.
bodyRequest body.
tlsConfigurationRequest TLS configuration
-
Whether request will be executed using secure socket.
Declaration
Swift
public var useTLS: Bool { get } -
Resolved port.
Declaration
Swift
public var port: Int { get }
View on GitHub
Install in Dash
Request Structure Reference