Class AccessTokenWithHeaders
Represents an access token that can be used to authorize a request. The token might be accompanied by extra information that should be sent in the form of headers.
Inherited Members
Namespace: Google.Apis.Auth.OAuth2
Assembly: Google.Apis.Auth.dll
Syntax
public sealed class AccessTokenWithHeaders
Constructors
AccessTokenWithHeaders(string, IReadOnlyDictionary<string, IReadOnlyList<string>>)
Constructs an AccessTokenWithHeaders based on a given token and headers.
Declaration
public AccessTokenWithHeaders(string token, IReadOnlyDictionary<string, IReadOnlyList<string>> headers)
Parameters
Type | Name | Description |
---|---|---|
string | token | The token to build this instance for. May be null. |
IReadOnlyDictionary<string, IReadOnlyList<string>> | headers | The collection of headers that may accompany the token. May be null. |
Properties
AccessToken
An access token that can be used to authorize a request.
Declaration
public string AccessToken { get; }
Property Value
Type | Description |
---|---|
string |
Headers
Extra headers, if any, that should be included in the request.
Declaration
public IReadOnlyDictionary<string, IReadOnlyList<string>> Headers { get; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<string, IReadOnlyList<string>> |
Methods
AddHeaders(HttpRequestHeaders)
Adds the headers in this object to the given header collection.
Declaration
public void AddHeaders(HttpRequestHeaders requestHeaders)
Parameters
Type | Name | Description |
---|---|---|
HttpRequestHeaders | requestHeaders | The header collection to add the headers to. |
AddHeaders(HttpRequestMessage)
Adds the headers in this object to the given request.
Declaration
public void AddHeaders(HttpRequestMessage request)
Parameters
Type | Name | Description |
---|---|---|
HttpRequestMessage | request | The request to add the headers to. |