I'm writing a JAX-RS 2.0 client to send RESTful requests and process the returned responses. To aid in debugging, I would like to log the actual HTTP request sent to the server and the HTTP response returned from the server. Is there a way to do this using the JAX-RS 2.0 API (without depending on specific implementation classes)?
I've looked at JAX-RS 2.0 filtering (see "How to log request body in JAX-RS client"); however the ClientResponseFilter and ClientResponseContext Interfaces are higher level abstractions and don't give access to the actual HTTP request and response sent over the socket connection. I even briefly looked at JAX-WS logging (see Log jax-ws http request and response), but this seems to offer server logging rather than client logging.