Interface Response

All Known Implementing Classes:
SimpleResponse

public interface Response
Implementation-agnostic representation of a HTTP response
  • Method Details

    • getStatus

      int getStatus()
      Returns:
      The response status code
    • getBody

      Deprecated.
      use getResponseBody(). This method will be removed in a future release.
      Returns:
      The response body, if there is one.
    • getResponseBody

      @Nonnull default Optional<Body> getResponseBody()
      Returns:
      the response body
    • getHeaderValues

      @Nonnull Collection<String> getHeaderValues(String name)
      Get the collection of header values for the header param with the given name.
      Parameters:
      name - The (case insensitive) name of the parameter to retrieve
      Returns:
      The header values for that param; or empty list
    • getHeaderValue

      @Nonnull default Optional<String> getHeaderValue(String name)
      Get the first of header value for the header param with the given name (if any exist).
      Parameters:
      name - The (case insensitive) name of the parameter to retrieve
      Returns:
      The first header value for that param (if it exists)
    • getContentType

      @Nonnull default Optional<String> getContentType()
      Get the content-type header of this response, if it has been set.
      Returns:
      The content-type header, or empty if it has not been set.