Interface Response
- All Superinterfaces:
Message
Represents the result of an HTTP request.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionintGets the status code of the response.Gets the status text of the response.booleanIndicates whether or not this response's status code is "Bad Request".booleanIndicates whether or not this response's status code is categorized as "Client Error" (4xx).booleanIndicates whether or not this response's status code is "Conflict".booleanIndicates whether or not this response's status code is "Created".booleanisError()Indicates whether or not this response's status code is categorized as either "Client Error" or "Server Error".booleanIndicates whether or not this response's status code is "Forbidden".booleanIndicates whether or not this response's status code is categorized as "Informational" (1xx).booleanIndicates whether or not this response's status code is "Internal Server Error".booleanIndicates whether or not this response's status code is "No Content".booleanIndicates whether or not this response's status code is "Not Found".booleanIndicates whether or not this response's status code is "Not Modified".booleanIndicates whether or not this response's status code is categorized as one of "Informational", "Redirection", "Client Error" or "Server Error".booleanisOk()Indicates whether or not this response's status code is "OK".booleanIndicates whether or not this response's status code is categorized as "Redirection" (3xx).booleanIndicates whether or not this response's status code is "See Other".booleanIndicates whether or not this response's status code is categorized as "Server Error" (5xx).booleanIndicates whether or not this response's status code is "Service Unavailable".booleanIndicates whether or not this response's status code is categorized as "Successful" (2xx).booleanIndicates whether or not this response's status code is "Unauthorized".Methods inherited from interface Message
getContentCharset, getContentLength, getContentType, getEntity, getEntityStream, getHeader, getHeaders, hasEntity, hasReadEntity
-
Method Details
-
getStatusCode
int getStatusCode()Gets the status code of the response.- Returns:
- The status code
-
getStatusText
-
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
-
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
-