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.
Inheritance
System.Object
AccessTokenWithHeaders
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
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 |
|---|---|---|
| System.String | token | The token to build this instance for. May be null. |
| System.Collections.Generic.IReadOnlyDictionary<System.String, System.Collections.Generic.IReadOnlyList<System.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 |
|---|---|
| System.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 |
|---|---|
| System.Collections.Generic.IReadOnlyDictionary<System.String, System.Collections.Generic.IReadOnlyList<System.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 |
|---|---|---|
| System.Net.Http.Headers.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 |
|---|---|---|
| System.Net.Http.HttpRequestMessage | request | The request to add the headers to. |