org.apache.hc.client5.http.async.methods

## 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:
  AsyncDataConsumer, AsyncResponseConsumer<SimpleHttpResponse>, ResourceHolder

    public final class SimpleResponseConsumer
    extends AbstractAsyncResponseConsumer<SimpleHttpResponse,byte[]>

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

IMPORTANT: `SimpleHttpResponse`s are intended for simple scenarios where entities inclosed in responses are known to be small. It is generally recommended to use streaming `AsyncResponseConsumer`s, for instance, such as based on `AbstractCharResponseConsumer` or `AbstractBinResponseConsumer`.

Since:
  5.0
See Also:
  `SimpleBody`, `SimpleHttpResponse`, `AbstractCharResponseConsumer`, `AbstractBinResponseConsumer`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`protected SimpleHttpResponse` `buildResult(HttpResponse response, byte[] entity, ContentType contentType)`
`static SimpleResponseConsumer` `create()` Creates a new SimpleResponseConsumer instance initialized with a new `SimpleAsyncEntityConsumer`.
`void` `informationResponse(HttpResponse response, HttpContext context)`

### Methods inherited from class org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer

`consume, consumeResponse, failed, releaseResources, streamEnd, updateCapacity`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### create

    public static SimpleResponseConsumer create()

Creates a new SimpleResponseConsumer instance initialized with a new `SimpleAsyncEntityConsumer`.

Returns:
  a new SimpleResponseConsumer instance.

#### informationResponse

    public void informationResponse(HttpResponse response,
                                    HttpContext context)
                             throws HttpException,
                                    IOException

Throws:
  `HttpException`
  `IOException`

#### buildResult

    protected SimpleHttpResponse buildResult(HttpResponse response,
                                             byte[] entity,
                                             ContentType contentType)

Specified by:
  `buildResult` in class `AbstractAsyncResponseConsumer<SimpleHttpResponse,byte[]>`