public class MaxUrlLengthInterceptor : IHttpExecuteInterceptorIntercepts 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-Overrideheader 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
IHttpExecuteInterceptorNamespace
GoogleApisHttpAssembly
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)| Parameters | |
|---|---|
| Name | Description |
request |
HttpRequestMessageThe HTTP request message. |
cancellationToken |
CancellationTokenCancellation token to cancel the operation. |
| Returns | |
|---|---|
| Type | Description |
Task |
|