URLRequest

extension URLRequest
  • A string describing the request, including headers and body.

    Declaration

    Swift

    public var debugDescription: String { get }
  • Signs the receiver by setting its “Authorization” header to “Bearer {token}”.

    Will throw if the OAuth2 instance does not have an access token.

    Declaration

    Swift

    public mutating func sign(with oauth2: OAuth2Base) throws

    Parameters

    oauth2

    The OAuth2 instance providing the access token to sign the request

  • Returns a copy of the receiver, signed by setting its “Authorization” header to “Bearer {token}”.

    Will throw if the OAuth2 instance does not have an access token.

    Declaration

    Swift

    public func signed(with oauth2: OAuth2Base) throws -> URLRequest

    Parameters

    oauth2

    The OAuth2 instance providing the access token to sign the receiver