@FunctionalInterface public interface PlayServiceCall<Request,Response> extends ServiceCall<Request,Response>
Modifier and Type | Method and Description |
---|---|
EssentialAction |
invoke(Function<ServiceCall<Request,Response>,EssentialAction> wrapCall)
Low level hook for implementing service calls directly in Play.
|
default CompletionStage<Response> |
invoke(Request request)
Invoke the service call.
|
handleRequestHeader, handleResponseHeader, invoke, withResponseHeader
default CompletionStage<Response> invoke(Request request)
ServiceCall
invoke
in interface ServiceCall<Request,Response>
request
- The request entity.EssentialAction invoke(Function<ServiceCall<Request,Response>,EssentialAction> wrapCall)
This can only be used to hook into plain HTTP calls, it can't be used to hook into WebSocket calls.
wrapCall
- A function that takes a service call, and converts it to an EssentialAction.
This action can then be composed to modify any part of the request and or response,
including request and response headers and the request and response body. This does not
have to be invoked at all if it's not desired, but may be useful to get the benefit of all
the Lagom features such as serialization and deserialization.