Interface RequestInterceptor

All Known Subinterfaces:
Auth
All Known Implementing Classes:
Basic, Sigv4
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface RequestInterceptor
Interceptors are run as an ordered list to allow modification of the HttpRequest before it is sent to the server. The interceptor receives an HttpRequest whose body starts as a RequestMessage. Interceptors mutate the request in place. After all interceptors run, if the body is still a RequestMessage the driver will auto-serialize it to JSON. Interceptors that need the serialized bytes (e.g., for signing) should call HttpRequest.serializeBody().
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    intercept(HttpRequest httpRequest)
    Intercept and mutate the HTTP request before it is sent.
  • Method Details

    • intercept

      void intercept(HttpRequest httpRequest)
      Intercept and mutate the HTTP request before it is sent.
      Parameters:
      httpRequest - the mutable HTTP request