org.apache.http.protocol
Class RequestContentHC4

java.lang.Object
  extended by org.apache.http.protocol.RequestContentHC4
All Implemented Interfaces:
org.apache.http.HttpRequestInterceptor

@Immutable
public class RequestContentHC4
extends java.lang.Object
implements org.apache.http.HttpRequestInterceptor

RequestContentHC4 is the most important interceptor for outgoing requests. It is responsible for delimiting content length by adding Content-Length or Transfer-Content headers based on the properties of the enclosed entity and the protocol version. This interceptor is required for correct functioning of client side protocol processors.

Since:
4.0

Constructor Summary
RequestContentHC4()
          Default constructor.
RequestContentHC4(boolean overwrite)
          Constructor that can be used to fine-tune behavior of this interceptor.
 
Method Summary
 void process(org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestContentHC4

public RequestContentHC4()
Default constructor. The Content-Length or Transfer-Encoding will cause the interceptor to throw ProtocolException if already present in the response message.


RequestContentHC4

public RequestContentHC4(boolean overwrite)
Constructor that can be used to fine-tune behavior of this interceptor.

Parameters:
overwrite - If set to true the Content-Length and Transfer-Encoding headers will be created or updated if already present. If set to false the Content-Length and Transfer-Encoding headers will cause the interceptor to throw ProtocolException if already present in the response message.
Since:
4.2
Method Detail

process

public void process(org.apache.http.HttpRequest request,
                    org.apache.http.protocol.HttpContext context)
             throws org.apache.http.HttpException,
                    java.io.IOException
Specified by:
process in interface org.apache.http.HttpRequestInterceptor
Throws:
org.apache.http.HttpException
java.io.IOException