Top Description Methods
org.apache.hc.core5.http

public Interface HttpRequestInterceptor

Known Direct Subinterfaces
org.apache.hc.core5.http.protocol.HttpProcessor
Known Direct Implementers
org.apache.hc.core5.http.protocol.RequestConnControl, org.apache.hc.core5.http.protocol.RequestContent, org.apache.hc.core5.http.protocol.RequestDate, org.apache.hc.core5.http.protocol.RequestExpectContinue, org.apache.hc.core5.http.protocol.RequestTargetHost, org.apache.hc.core5.http.protocol.RequestUserAgent, org.apache.hc.core5.http.protocol.RequestValidateHost
Annotations
@Contract
threading:STATELESS
Imports
java.io.IOException, org.apache.hc.core5.annotation.Contract, .ThreadingBehavior, org.apache.hc.core5.http.protocol.HttpContext

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

Modifier and TypeMethod and Description
public void
process(HttpRequest
the request to process
request
,
EntityDetails
the request entity details or null if not available
entity
,
HttpContext
the context for the request
context
)

Processes a request.

Method Detail

processback to summary
public void process(HttpRequest request, EntityDetails entity, HttpContext context) throws HttpException, IOException

Processes a request. On the client side, this step is performed before the request is sent to the server. On the server side, this step is performed on incoming messages before the message body is evaluated.

Parameters
request:HttpRequest

the request to process

entity:EntityDetails

the request entity details or null if not available

context:HttpContext

the context for the request

Exceptions
HttpException:
in case of an HTTP protocol violation
IOException:
in case of an I/O error