URLRequest

extension URLRequest: URLRequestConvertible
  • Returns a URL request or throws if an Error was encountered.

    Declaration

    Swift

    public func asURLRequest() throws -> URLRequest
  • Creates an instance with the specified method, urlString and headers.

    Declaration

    Swift

    public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throws

    Parameters

    url

    The URL.

    method

    The HTTP method.

    headers

    The HTTP headers. nil by default.

    Return Value

    The new URLRequest instance.