@Contract(threading=IMMUTABLE) public class ResponseContent extends Object implements HttpResponseInterceptor
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 server side protocol
processors.| 构造器和说明 |
|---|
ResponseContent()
Default constructor.
|
ResponseContent(boolean overwrite)
Constructor that can be used to fine-tune behavior of this interceptor.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
process(HttpResponse response,
EntityDetails entity,
HttpContext context)
Processes the response (possibly updating or inserting) Content-Length and Transfer-Encoding headers.
|
public ResponseContent()
Content-Length or Transfer-Encoding
will cause the interceptor to throw ProtocolException if already present in the
response message.public ResponseContent(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(HttpResponse response, EntityDetails entity, HttpContext context) throws HttpException, IOException
process 在接口中 HttpResponseInterceptorresponse - The HttpResponse to modify.context - Unused.entity - the request entity details or null if not availableProtocolException - If either the Content-Length or Transfer-Encoding headers are found.IllegalArgumentException - If the response is null.HttpException - in case of an HTTP protocol violationIOException - in case of an I/O errorCopyright © 2023. All rights reserved.