Class SimpleResponseConsumer
- java.lang.Object
-
- org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer<SimpleHttpResponse,byte[]>
-
- org.apache.hc.client5.http.async.methods.SimpleResponseConsumer
-
- All Implemented Interfaces:
org.apache.hc.core5.http.nio.AsyncDataConsumer,org.apache.hc.core5.http.nio.AsyncResponseConsumer<SimpleHttpResponse>,org.apache.hc.core5.http.nio.ResourceHolder
public final class SimpleResponseConsumer extends org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer<SimpleHttpResponse,byte[]>
HTTP response consumer that generates aSimpleHttpResponseinstance based on events of an incoming data stream.IMPORTANT:
SimpleHttpResponses are intended for simple scenarios where entities inclosed in responses are known to be small. It is generally recommended to use streamingAsyncResponseConsumers, for instance, such as based onAbstractCharResponseConsumerorAbstractBinResponseConsumer.- Since:
- 5.0
- See Also:
SimpleBody,SimpleHttpResponse,AbstractCharResponseConsumer,AbstractBinResponseConsumer
-
-
Constructor Summary
Constructors Constructor Description SimpleResponseConsumer(org.apache.hc.core5.http.nio.AsyncEntityConsumer<byte[]> entityConsumer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SimpleHttpResponsebuildResult(org.apache.hc.core5.http.HttpResponse response, byte[] entity, org.apache.hc.core5.http.ContentType contentType)static SimpleResponseConsumercreate()voidinformationResponse(org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.protocol.HttpContext context)
-
-
-
Method Detail
-
create
public static SimpleResponseConsumer create()
-
informationResponse
public void informationResponse(org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.http.protocol.HttpContext context) throws org.apache.hc.core5.http.HttpException, java.io.IOException- Throws:
org.apache.hc.core5.http.HttpExceptionjava.io.IOException
-
buildResult
protected SimpleHttpResponse buildResult(org.apache.hc.core5.http.HttpResponse response, byte[] entity, org.apache.hc.core5.http.ContentType contentType)
- Specified by:
buildResultin classorg.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer<SimpleHttpResponse,byte[]>
-
-