EXTENSION

URLRequest

public extension URLRequest

Methods

addAuthorizationHeader(headerValue:)

mutating func addAuthorizationHeader(headerValue: String)

Add an Authorization HTTP request header to the URLRequest instance

Parameters

Name Description
headerValue value to set for the Authorization header

addDpopHeader(headerValue:)

mutating func addDpopHeader(headerValue: String)

Add a DPoP HTTP request header to the URLRequest instance

Parameters

Name Description
headerValue value to set for the DPoP header

addDpopAccessTokenHeaders(from:httpMethod:url:)

mutating func addDpopAccessTokenHeaders(from dpopAccessTokenInfo: DpopAccessTokenInfo, httpMethod: String, url: URL) throws

Add both a Authorization as well as a DPoP HTTP request header to the URLRequest instance. The value to use for the DPoP HTTP request header is calculated for the provided httpMethod and url.

Parameters

Name Description
dpopAccessTokenInfo a DpopAccessTokenInfo instance that contains the AccessToken value to set as Authorization header value
httpMethod the HTTP method to calculate the DPoP proof token value for
url the URL to calculate the DPoP proof token value for

addHaapiMediaTypeAcceptHeader()

mutating func addHaapiMediaTypeAcceptHeader()

Add the HTTP content type request header with the HAAPI content type to the URLRequest instance

addHaapiSessionIdHeader(_:)

mutating func addHaapiSessionIdHeader(_ sessionId: String)

Add a HAAPI Session-Id HTTP request header to the URLRequest instance

Parameters

Name Description
headerValue value to set for the Session-Id header