Interface RequestInterceptor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
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 TypeMethodDescriptionvoidintercept(HttpRequest httpRequest) Intercept and mutate the HTTP request before it is sent.
-
Method Details
-
intercept
Intercept and mutate the HTTP request before it is sent.- Parameters:
httpRequest- the mutable HTTP request
-