// Some setup steps
ResteasyProviderFactory factory = new ResteasyProviderFactory();
factory.registerProvider(com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider.class);
Client client = ClientBuilder.newClient(new ClientConfiguration(factory));
WebTarget target = client.target(webappURL.toURI() + "api/v1");
resteasyWebTarget = (ResteasyWebTarget) target;
// the real request
MyApiController myApiController = resteasyWebTarget.proxy(MyApiController.class);
ClientResponse response = (ClientResponse) myApiController.doSomeStuff();
上面的代码效果很好,但我想真正了解真正的 http 请求和真正的 http 响应时发生了什么
myApiController.doSomeStuff();
被执行。
我想知道捕获和记录“原始”请求以及捕获并记录“原始”http 响应的最佳方法是什么。我只对resteasy-client 3.0.2.Final 或类似的解决方案感兴趣...
谢谢!