Java Code Examples for org.apache.http.impl.client.AbstractHttpClient#addRequestInterceptor()

The following examples show how to use org.apache.http.impl.client.AbstractHttpClient#addRequestInterceptor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CurlLoggingRestAssuredConfigFactory.java    From curl-logger with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
@SuppressWarnings("deprecation")
public HttpClient createHttpClient() {
  final AbstractHttpClient client = (AbstractHttpClient) wrappedFactory.createHttpClient();
  client.addRequestInterceptor(curlLoggingInterceptor);
  return client;
}
 
Example 2
Source File: UsingWithRestAssuredTest.java    From curl-logger with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@SuppressWarnings("deprecation")
@Override
public HttpClient createHttpClient() {
  AbstractHttpClient client = new DefaultHttpClient();
  client.addRequestInterceptor(new CurlTestingInterceptor(curlConsumer));
  return client;
}
 
Example 3
Source File: LayerHttpServiceImpl.java    From geomajas-project-server with GNU Affero General Public License v3.0 5 votes vote down vote up
@Override
public void setClient(AbstractHttpClient client) {
	this.client = client;
	// add an interceptor that picks up the autowired interceptors, remove first to avoid doubles
	client.removeRequestInterceptorByClass(CompositeInterceptor.class);
	client.addRequestInterceptor(new CompositeInterceptor());
}
 
Example 4
Source File: CurlLoggingInterceptorTest.java    From curl-logger with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public HttpClient createHttpClient() {
  @SuppressWarnings("deprecation") AbstractHttpClient client = new DefaultHttpClient();
  client.addRequestInterceptor(curlLoggingInterceptor);
  return client;
}