com.atlassian.httpclient.api
Interface Response

All Superinterfaces:
Message

public interface Response
extends Message

Represents the result of an HTTP request.


Nested Class Summary
static interface Response.Builder
           
 
Method Summary
 int getStatusCode()
          Gets the status code of the response.
 String getStatusText()
          Gets the status text of the response.
 boolean isBadRequest()
          Indicates whether or not this response's status code is "Bad Request".
 boolean isClientError()
          Indicates whether or not this response's status code is categorized as "Client Error" (4xx).
 boolean isConflict()
          Indicates whether or not this response's status code is "Conflict".
 boolean isCreated()
          Indicates whether or not this response's status code is "Created".
 boolean isError()
          Indicates whether or not this response's status code is categorized as either "Client Error" or "Server Error".
 boolean isForbidden()
          Indicates whether or not this response's status code is "Forbidden".
 boolean isInformational()
          Indicates whether or not this response's status code is categorized as "Informational" (1xx).
 boolean isInternalServerError()
          Indicates whether or not this response's status code is "Internal Server Error".
 boolean isNoContent()
          Indicates whether or not this response's status code is "No Content".
 boolean isNotFound()
          Indicates whether or not this response's status code is "Not Found".
 boolean isNotModified()
          Indicates whether or not this response's status code is "Not Modified".
 boolean isNotSuccessful()
          Indicates whether or not this response's status code is categorized as one of "Informational", "Redirection", "Client Error" or "Server Error".
 boolean isOk()
          Indicates whether or not this response's status code is "OK".
 boolean isRedirection()
          Indicates whether or not this response's status code is categorized as "Redirection" (3xx).
 boolean isSeeOther()
          Indicates whether or not this response's status code is "See Other".
 boolean isServerError()
          Indicates whether or not this response's status code is categorized as "Server Error" (5xx).
 boolean isServiceUnavailable()
          Indicates whether or not this response's status code is "Service Unavailable".
 boolean isSuccessful()
          Indicates whether or not this response's status code is categorized as "Successful" (2xx).
 boolean isUnauthorized()
          Indicates whether or not this response's status code is "Unauthorized".
 
Methods inherited from interface com.atlassian.httpclient.api.Message
getContentCharset, getContentLength, getContentType, getEntity, getEntityStream, getHeader, getHeaders, hasEntity, hasReadEntity
 

Method Detail

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


Copyright © 2012–2015 Atlassian. All rights reserved.