Class MaxUrlLengthInterceptor (1.60.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

Inheritance

object > MaxUrlLengthInterceptor

Namespace

GoogleApisHttp

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 Method