1.73.0 (latest) 1.69.0 1.68.0 1.60.0 1.59.0 1.55.0 1.50.0

    public interface IHttpExecuteInterceptor

HTTP request execute interceptor to intercept a [HttpRequestMessage](https://learn.microsoft.com/dotnet/api/system.net.http.httprequestmessage) before it has
been sent. Sample usage is attaching "Authorization" header to a request.

## Namespace

[Google.Apis.Http](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.md.txt)

## Assembly

Google.Apis.Core.dll

## Methods

### InterceptAsync(HttpRequestMessage, CancellationToken)

    Task InterceptAsync(HttpRequestMessage request, CancellationToken cancellationToken)

Invoked before the request is being sent.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `HttpRequestMessage` The HTTP request message. |
| `cancellationToken` | `CancellationToken` Cancellation token to cancel the operation. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Task` |   |

## Extension Methods

[HttpExtenstions.ToDelegatingHandler(IHttpExecuteInterceptor)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.HttpExtenstions.md.txt#Google_Apis_Http_HttpExtenstions_ToDelegatingHandler_Google_Apis_Http_IHttpExecuteInterceptor_) [HttpExtenstions.ToDelegatingHandler(IHttpExecuteInterceptor, HttpMessageHandler)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Http.HttpExtenstions.md.txt#Google_Apis_Http_HttpExtenstions_ToDelegatingHandler_Google_Apis_Http_IHttpExecuteInterceptor_System_Net_Http_HttpMessageHandler_) [Utilities.ThrowIfNull\<T\>(T, string)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Apis/latest/Google.Apis.Util.Utilities.md.txt#Google_Apis_Util_Utilities_ThrowIfNull__1___0_System_String_)