Top Description Constructors Methods
org.apache.hc.client5.http.async.methods

public final Class SimpleResponseConsumer

extends AbstractAsyncResponseConsumer<SimpleHttpResponse, byte[]>
Class Inheritance
Imports
java.io.IOException, org.apache.hc.core5.http.ContentType, .HttpException, .HttpResponse, org.apache.hc.core5.http.nio.AsyncEntityConsumer, org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer, org.apache.hc.core5.http.protocol.HttpContext

HTTP response consumer that generates a SimpleHttpResponse instance based on events of an incoming data stream.

Important Note

SimpleHttpResponses are intended for simple scenarios where entities inclosed in responses are known to be small. It is generally recommended to use streaming org.apache.hc.core5.http.nio.AsyncResponseConsumers, for instance, such as based on AbstractCharResponseConsumer or AbstractBinResponseConsumer.

Since
5.0
See Also
SimpleBody, SimpleHttpResponse, AbstractCharResponseConsumer, AbstractBinResponseConsumer

Constructor Summary

AccessConstructor and Description
pack-priv
SimpleResponseConsumer(final AsyncEntityConsumer<byte[]> entityConsumer)

Method Summary

Modifier and TypeMethod and Description
protected SimpleHttpResponse
buildResult(final HttpResponse
the response message.
response
,
final byte[]
the response entity.
entity
,
final ContentType
the response content type.
contentType
)

Implements abstract org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer.buildResult.

Triggered to generate object that represents a result of response message processing.
public static SimpleResponseConsumer
public void
informationResponse(final HttpResponse
the intermediate (1xx) HTTP response.
response
,
final HttpContext
the actual execution context.
context
)

Implements org.apache.hc.core5.http.nio.AsyncResponseConsumer.informationResponse.

Triggered to signal receipt of an intermediate (1xx) HTTP response.
Inherited from org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer:
consumeconsumeResponsefailedreleaseResourcesstreamEndupdateCapacity

Constructor Detail

SimpleResponseConsumerback to summary
pack-priv SimpleResponseConsumer(final AsyncEntityConsumer<byte[]> entityConsumer)

Method Detail

buildResultback to summary
protected SimpleHttpResponse buildResult(final HttpResponse response, final byte[] entity, final ContentType contentType)

Implements abstract org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer.buildResult.

Doc from org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer.buildResult.

Triggered to generate object that represents a result of response message processing.

Parameters
response:HttpResponse

the response message.

entity:byte[]

the response entity.

contentType:ContentType

the response content type.

Returns:SimpleHttpResponse

the result of response processing.

Annotations
@Override
createback to summary
public static SimpleResponseConsumer create()
informationResponseback to summary
public void informationResponse(final HttpResponse response, final HttpContext context) throws HttpException, IOException

Implements org.apache.hc.core5.http.nio.AsyncResponseConsumer.informationResponse.

Doc from org.apache.hc.core5.http.nio.AsyncResponseConsumer.informationResponse.

Triggered to signal receipt of an intermediate (1xx) HTTP response.

Parameters
response:HttpResponse

the intermediate (1xx) HTTP response.

context:HttpContext

the actual execution context.

Annotations
@Override