Interface TransportHttpClient.Response

All Superinterfaces:
AutoCloseable, Closeable
Enclosing interface:
TransportHttpClient

public static interface TransportHttpClient.Response extends Closeable
An http response.
  • Method Summary

    Modifier and Type
    Method
    Description
    The response body, if any.
    void
    Close this response, freeing its associated resources if needed, such as consuming the response body.
    header(String name)
    Get a header value, or the first value if the header has multiple values.
    Get all values for a given header name.
    The host/node that was used to send the request.
    The original response of the underlying http library, if available.
    int
    The response status code.
  • Method Details

    • node

      The host/node that was used to send the request. It may be different from the one that was provided with the request if the http client has a multi-node retry strategy.
    • statusCode

      int statusCode()
      The response status code.
    • header

      @Nullable String header(String name)
      Get a header value, or the first value if the header has multiple values.

      Note: header names are case-insensitive

    • headers

      List<String> headers(String name)
      Get all values for a given header name.

      Note: header names are case-insensitive

    • body

      @Nullable BinaryData body() throws IOException
      The response body, if any.
      Throws:
      IOException
    • originalResponse

      @Nullable Object originalResponse()
      The original response of the underlying http library, if available.
    • close

      void close() throws IOException
      Close this response, freeing its associated resources if needed, such as consuming the response body.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException