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 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
Google.Apis.HttpAssembly
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 |
HttpRequestMessage The HTTP request message. |
cancellationToken |
CancellationToken Cancellation token to cancel the operation. |
Returns | |
---|---|
Type | Description |
Task |