org.apache.hc.core5.http

## Interface HttpResponseInterceptor

- All Known Subinterfaces:
    HttpProcessor
  All Known Implementing Classes:
    DefaultHttpProcessor, H2ResponseConnControl, H2ResponseContent, ResponseConnControl, ResponseContent, ResponseDate, ResponseServer

      @Contract(threading=STATELESS)
      public interface HttpResponseInterceptor

  HTTP protocol interceptor is a routine that implements a specific aspect of the HTTP protocol. Usually protocol interceptors are expected to act upon one specific header or a group of related headers of the incoming message or populate the outgoing message with one specific header or a group of related headers. Protocol

  Interceptors can also manipulate content entities enclosed with messages. Usually this is accomplished by using the 'Decorator' pattern where a wrapper entity class is used to decorate the original entity.

  Protocol interceptors must be implemented as thread-safe. Similarly to servlets, protocol interceptors should not use instance variables unless access to those variables is synchronized.

  Since:
    4.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `process(HttpResponse response, EntityDetails entity, HttpContext context)` Processes a response.

- - ### Method Detail

    - #### process

          void process(HttpResponse response,
                     EntityDetails entity,
                     HttpContext context)
                       throws HttpException,
                              IOException

      Processes a response. On the server side, this step is performed before the response is sent to the client. On the client side, this step is performed on incoming messages before the message body is evaluated.
      Parameters:
        `response` - the response to process
        `entity` - the request entity details or `null` if not available
        `context` - the context for the request
      Throws:
        `HttpException` - in case of an HTTP protocol violation
        `IOException` - in case of an I/O error

Copyright © 2005–2020 The Apache Software Foundation. All rights reserved.