Interface Response

All Superinterfaces:
Message

public interface Response extends Message
Represents the result of an HTTP request.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the status code of the response.
    Gets the status text of the response.
    boolean
    Indicates whether or not this response's status code is "Bad Request".
    boolean
    Indicates whether or not this response's status code is categorized as "Client Error" (4xx).
    boolean
    Indicates whether or not this response's status code is "Conflict".
    boolean
    Indicates whether or not this response's status code is "Created".
    boolean
    Indicates whether or not this response's status code is categorized as either "Client Error" or "Server Error".
    boolean
    Indicates whether or not this response's status code is "Forbidden".
    boolean
    Indicates whether or not this response's status code is categorized as "Informational" (1xx).
    boolean
    Indicates whether or not this response's status code is "Internal Server Error".
    boolean
    Indicates whether or not this response's status code is "No Content".
    boolean
    Indicates whether or not this response's status code is "Not Found".
    boolean
    Indicates whether or not this response's status code is "Not Modified".
    boolean
    Indicates whether or not this response's status code is categorized as one of "Informational", "Redirection", "Client Error" or "Server Error".
    boolean
    Indicates whether or not this response's status code is "OK".
    boolean
    Indicates whether or not this response's status code is categorized as "Redirection" (3xx).
    boolean
    Indicates whether or not this response's status code is "See Other".
    boolean
    Indicates whether or not this response's status code is categorized as "Server Error" (5xx).
    boolean
    Indicates whether or not this response's status code is "Service Unavailable".
    boolean
    Indicates whether or not this response's status code is categorized as "Successful" (2xx).
    boolean
    Indicates whether or not this response's status code is "Unauthorized".
  • Method Details

    • getStatusCode

      int getStatusCode()
      Gets the status code of the response.
      Returns:
      The status code
    • getStatusText

      String getStatusText()
      Gets the status text of the response.
      Returns:
      The status text
    • isInformational

      boolean isInformational()
      Indicates whether or not this response's status code is categorized as "Informational" (1xx).
      Returns:
      True if status code gte 100 and lt 200
    • isSuccessful

      boolean isSuccessful()
      Indicates whether or not this response's status code is categorized as "Successful" (2xx).
      Returns:
      True if status code gte 200 and lt 300
    • isOk

      boolean isOk()
      Indicates whether or not this response's status code is "OK".
      Returns:
      True if status code is 200
    • isCreated

      boolean isCreated()
      Indicates whether or not this response's status code is "Created".
      Returns:
      True if status code is 201
    • isNoContent

      boolean isNoContent()
      Indicates whether or not this response's status code is "No Content".
      Returns:
      True if status code is 204
    • isRedirection

      boolean isRedirection()
      Indicates whether or not this response's status code is categorized as "Redirection" (3xx).
      Returns:
      True if status code gte 300 and lt 400
    • isSeeOther

      boolean isSeeOther()
      Indicates whether or not this response's status code is "See Other".
      Returns:
      True if status code is 303
    • isNotModified

      boolean isNotModified()
      Indicates whether or not this response's status code is "Not Modified".
      Returns:
      True if status code is 304
    • isClientError

      boolean isClientError()
      Indicates whether or not this response's status code is categorized as "Client Error" (4xx).
      Returns:
      True if status code gte 400 and lt 500
    • isBadRequest

      boolean isBadRequest()
      Indicates whether or not this response's status code is "Bad Request".
      Returns:
      True if status code is 400
    • isUnauthorized

      boolean isUnauthorized()
      Indicates whether or not this response's status code is "Unauthorized".
      Returns:
      True if status code is 401
    • isForbidden

      boolean isForbidden()
      Indicates whether or not this response's status code is "Forbidden".
      Returns:
      True if status code is 403
    • isNotFound

      boolean isNotFound()
      Indicates whether or not this response's status code is "Not Found".
      Returns:
      True if status code is 404
    • isConflict

      boolean isConflict()
      Indicates whether or not this response's status code is "Conflict".
      Returns:
      True if status code is 409
    • isServerError

      boolean isServerError()
      Indicates whether or not this response's status code is categorized as "Server Error" (5xx).
      Returns:
      True if status code gte 500 and lt 600
    • isInternalServerError

      boolean isInternalServerError()
      Indicates whether or not this response's status code is "Internal Server Error".
      Returns:
      True if status code is 500
    • isServiceUnavailable

      boolean isServiceUnavailable()
      Indicates whether or not this response's status code is "Service Unavailable".
      Returns:
      True if status code is 503
    • isError

      boolean isError()
      Indicates whether or not this response's status code is categorized as either "Client Error" or "Server Error".
      Returns:
      True if either of isClientError() or isServerError() is true
    • isNotSuccessful

      boolean isNotSuccessful()
      Indicates whether or not this response's status code is categorized as one of "Informational", "Redirection", "Client Error" or "Server Error".
      Returns:
      True if one of isInformational(), isRedirection() or isError() is true