public sealed class AccessTokenWithHeadersRepresents 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.
Namespace
Google.Apis.Auth.OAuth2Assembly
Google.Apis.Auth.dll
Constructors
AccessTokenWithHeaders(string, IReadOnlyDictionary<string, IReadOnlyList<string>>)
public AccessTokenWithHeaders(string token, IReadOnlyDictionary<string, IReadOnlyList<string>> headers)Constructs an AccessTokenWithHeaders based on a given token and headers.
| Parameters | |
|---|---|
| Name | Description |
token |
stringThe token to build this instance for. May be null. |
headers |
IReadOnlyDictionarystringIReadOnlyListstringThe collection of headers that may accompany the token. May be null. |
Properties
AccessToken
public string AccessToken { get; }An access token that can be used to authorize a request.
| Property Value | |
|---|---|
| Type | Description |
string |
|
Headers
public IReadOnlyDictionary<string, IReadOnlyList<string>> Headers { get; }Extra headers, if any, that should be included in the request.
| Property Value | |
|---|---|
| Type | Description |
IReadOnlyDictionarystringIReadOnlyListstring |
|
Methods
AddHeaders(HttpRequestHeaders)
public void AddHeaders(HttpRequestHeaders requestHeaders)Adds the headers in this object to the given header collection.
| Parameter | |
|---|---|
| Name | Description |
requestHeaders |
HttpRequestHeadersThe header collection to add the headers to. |
AddHeaders(HttpRequestMessage)
public void AddHeaders(HttpRequestMessage request)Adds the headers in this object to the given request.
| Parameter | |
|---|---|
| Name | Description |
request |
HttpRequestMessageThe request to add the headers to. |