Class MaxUrlLengthInterceptor (1.59.0)

Stay organized with collections Save and categorize content based on your preferences.
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

Inheritance

Object > MaxUrlLengthInterceptor

Namespace

Google.Apis.Http

Assembly

Google.Apis.Core.dll

Constructors

MaxUrlLengthInterceptor(UInt32)

public MaxUrlLengthInterceptor(uint maxUrlLength)

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

Parameter
NameDescription
maxUrlLengthUInt32

Methods

InterceptAsync(HttpRequestMessage, CancellationToken)

public Task InterceptAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Invoked before the request is being sent.
Parameters
NameDescription
requestHttpRequestMessage

The HTTP request message.

cancellationTokenCancellationToken

Cancellation token to cancel the operation.

Returns
TypeDescription
Task

Extension Method