November 2017
Intermediate to advanced
420 pages
10h 29m
English
You can build a client-side response filter by implementing the javax.ws.rs.client.ClientResponseFilter interface. This filter is used for manipulating the response message returned by the REST APIs.
The following code snippet shows the use of JAXRSClientResponseFilter to check the response received from the server and then log the error (if any) for audit purposes:
//Other imports are omitted for brevity import javax.ws.rs.client.ClientRequestContext; import javax.ws.rs.client.ClientResponseContext; import javax.ws.rs.client.ClientResponseFilter; public class JAXRSClientResponseFilter implements ClientResponseFilter { @Override public void filter(ClientRequestContext reqContext, ClientResponseContext ...