org.apache.hc.core5.http.nio

## Interface AsyncResponseConsumer<T>

- Type Parameters:
    `T` - response representation.
  All Superinterfaces:
    AsyncDataConsumer, ResourceHolder
  All Known Implementing Classes:
    AbstractAsyncResponseConsumer, BasicResponseConsumer, ReactiveResponseConsumer

      public interface AsyncResponseConsumer<T>
      extends AsyncDataConsumer

  Abstract asynchronous response consumer.
  Since:
    5.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `consumeResponse(HttpResponse response, EntityDetails entityDetails, HttpContext context, FutureCallback<T> resultCallback)` Triggered to signal receipt of a response message head.
    `void` | `failed(Exception cause)` Triggered to signal a failure in data processing.
    `void` | `informationResponse(HttpResponse response, HttpContext context)` Triggered to signal receipt of an intermediate (1xx) HTTP response.

    - ### Methods inherited from interface org.apache.hc.core5.http.nio.AsyncDataConsumer

      `consume, streamEnd, updateCapacity`

    - ### Methods inherited from interface org.apache.hc.core5.http.nio.ResourceHolder

      `releaseResources`

- - ### Method Detail

    - #### consumeResponse

          void consumeResponse(HttpResponse response,
                               EntityDetails entityDetails,
                               HttpContext context,
                               FutureCallback<T> resultCallback)
                        throws HttpException,
                               IOException

      Triggered to signal receipt of a response message head.
      Parameters:
        `response` - the response message head.
        `entityDetails` - the response entity details or `null` if the response does not enclose an entity.
        `context` - the actual execution context.
        `resultCallback` - the result callback called when response processing has been completed successfully or unsuccessfully.
      Throws:
        `HttpException`
        `IOException`

    - #### informationResponse

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

      Triggered to signal receipt of an intermediate (1xx) HTTP response.
      Parameters:
        `response` - the intermediate (1xx) HTTP response.
        `context` - the actual execution context.
      Throws:
        `HttpException`
        `IOException`

    - #### failed

          void failed(Exception cause)

      Triggered to signal a failure in data processing.
      Parameters:
        `cause` - the cause of the failure.

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.