Interface APIResponse

All Known Implementing Classes:
APIResponseImpl

public interface APIResponse
APIResponse class represents responses returned by APIRequestContext.get() and similar methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Returns the buffer with response body.
    void
    Disposes the body of this response.
    An object with all the response HTTP headers associated with this response.
    An array with all the request HTTP headers associated with this response.
    boolean
    ok()
    Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
    int
    Contains the status code of the response (e.g., 200 for a success).
    Contains the status text of the response (e.g.
    Returns the text representation of response body.
    url()
    Contains the URL of the response.
  • Method Details

    • body

      byte[] body()
      Returns the buffer with response body.
      Since:
      v1.16
    • dispose

      void dispose()
      Disposes the body of this response. If not called then the body will stay in memory until the context closes.
      Since:
      v1.16
    • headers

      Map<String,String> headers()
      An object with all the response HTTP headers associated with this response.
      Since:
      v1.16
    • headersArray

      List<HttpHeader> headersArray()
      An array with all the request HTTP headers associated with this response. Header names are not lower-cased. Headers with multiple entries, such as Set-Cookie, appear in the array multiple times.
      Since:
      v1.16
    • ok

      boolean ok()
      Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
      Since:
      v1.16
    • status

      int status()
      Contains the status code of the response (e.g., 200 for a success).
      Since:
      v1.16
    • statusText

      String statusText()
      Contains the status text of the response (e.g. usually an "OK" for a success).
      Since:
      v1.16
    • text

      String text()
      Returns the text representation of response body.
      Since:
      v1.16
    • url

      String url()
      Contains the URL of the response.
      Since:
      v1.16