1.73.0 (latest) 1.69.0 1.68.0 1.60.0 1.59.0 1.55.0 1.50.0

    public class MaxUrlLengthInterceptor : IHttpExecuteInterceptor

Intercepts HTTP GET requests with a URLs longer than a specified maximum number of characters.
The interceptor will change such requests as follows:

- The request's method will be changed to POST
- A `X-HTTP-Method-Override` header will be added with the value `GET`
- Any query parameters from the URI will be moved into the body of the request.
- If query parameters are moved, the content type is set to `application/x-www-form-urlencoded`

<br />

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> MaxUrlLengthInterceptor

## Implements

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

## Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## 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

## Constructors

### MaxUrlLengthInterceptor(uint)

    public MaxUrlLengthInterceptor(uint maxUrlLength)

Constructs a new Max URL length interceptor with the given max length.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `maxUrlLength` | `uint` |

## Methods

### InterceptAsync(HttpRequestMessage, CancellationToken)

    public 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_)