@Contract(threading=IMMUTABLE) public class RequestContent extends Object implements HttpRequestInterceptor
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.| 限定符和类型 | 字段和说明 |
|---|---|
static HttpRequestInterceptor |
INSTANCE
Singleton instance.
|
| 构造器和说明 |
|---|
RequestContent()
Default constructor.
|
RequestContent(boolean overwrite)
Constructor that can be used to fine-tune behavior of this interceptor.
|
public static final HttpRequestInterceptor INSTANCE
public RequestContent()
Content-Length or Transfer-Encoding
will cause the interceptor to throw ProtocolException if already present in the
response message.public RequestContent(boolean overwrite)
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.public void process(HttpRequest request, EntityDetails entity, HttpContext context) throws HttpException, IOException
HttpRequestInterceptorprocess 在接口中 HttpRequestInterceptorrequest - the request to processentity - the request entity details or null if not availablecontext - the context for the requestHttpException - in case of an HTTP protocol violationIOException - in case of an I/O errorCopyright © 2023. All rights reserved.