This document contains documentation for the
tracee-httpcomponents
module. Check the TracEE main documentation to get started.
TODO Wrapper for apache http client 4+
This module contains two interceptors:
- TraceeHttpRequestInterceptor: Implements the
HttpRequestInterceptor
interface to add the tracee header to the request. - TraceeHttpResponseInterceptor: Implements the
HttpResponseInterceptor
to extract the tracee header from the response.
<dependencies>
...
<dependency>
<groupId>io.tracee.binding</groupId>
<artifactId>tracee-httpcomponents</artifactId>
<version>${tracee.version}</version>
</dependency>
...
</dependencies>
Then add simply two interceptors to your HttpClient of the httpcomponents module:
DefaultHttpClient httpClient = new DefaultHttpClient();
httpClient.addRequestInterceptor(new TraceeHttpRequestInterceptor());
httpClient.addResponseInterceptor(new TraceeHttpResponseInterceptor());