Interface HttpResponse

All Known Implementing Classes:
HttpResponseDefault

public interface HttpResponse
  • Method Details

    • getStatus

      int getStatus()
      Gets the HTTP status.
    • getContentType

      String getContentType()
      Gets the Content-Type.
    • getHeaders

      Map<String,List<String>> getHeaders()
      Gets the headers.
    • getHeader

      List<String> getHeader(String name)
      Gets an header. An header can have more than one value.
    • getHeaderFirst

      String getHeaderFirst(String name)
      Gets the first value of an header.
    • getCookies

      Map<String,Cookie> getCookies()
      Gets the cookies.
    • getCookie

      Cookie getCookie(String name)
      Gets a cookie.
    • getCookieValue

      String getCookieValue(String name)
      Gets the value of a cookie.
      Returns:
      the value of the cookie or null if the cookie doesn't exist.
    • isGzipped

      boolean isGzipped()
      Is the response gzipped?
    • getContentAsString

      String getContentAsString()
      Gets the content as a UTF-8 String.
    • getContentAsString

      String getContentAsString(String encoding)
      Gets the content as a String using the specified encoding.
    • getContentAsJsonObject

      JsonObject getContentAsJsonObject()
      Gets the content as a JsonObject. This expects the content to be a valid Json string or an exception is thrown.
    • getContentAsByteArray

      byte[] getContentAsByteArray()
      Get the content as byte[].