EXTENSION

URLRequest

swift
public extension URLRequest

Properties

masked

swift
public var masked: String

Methods

addAuthorizationHeader(headerValue:)

swift
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:)

swift
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:)

swift
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()

swift
mutating func addHaapiMediaTypeAcceptHeader()

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

addHaapiSessionIdHeader(_:)

swift
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