Class MaxUrlLengthInterceptor
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 valueGET
- 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
Implements
Inherited Members
Namespace: Google.Apis.Http
Assembly: Google.Apis.Core.dll
Syntax
public class MaxUrlLengthInterceptor : IHttpExecuteInterceptor
Constructors
MaxUrlLengthInterceptor(uint)
Constructs a new Max URL length interceptor with the given max length.
Declaration
public MaxUrlLengthInterceptor(uint maxUrlLength)
Parameters
Type | Name | Description |
---|---|---|
uint | maxUrlLength |
Methods
InterceptAsync(HttpRequestMessage, CancellationToken)
Declaration
public Task InterceptAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
HttpRequestMessage | request | The HTTP request message. |
CancellationToken | cancellationToken | Cancellation token to cancel the operation. |
Returns
Type | Description |
---|---|
Task |