Package com.google.gwt.http.client
Class Response
java.lang.Object
com.google.gwt.http.client.Response
- Direct Known Subclasses:
ResponseImpl
Wrapper which provides access to the components of an HTTP response.
Required Module
Modules that use this class should inheritcom.google.gwt.http.HTTP
.
<module> <!-- other inherited modules, such as com.google.gwt.user.User --> <inherits name="com.google.gwt.http.HTTP"/> <!-- additional module settings --> </module>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
Returns the value of the requested header or null if the header was not specified.abstract Header[]
Returns an array of HTTP headers associated with this response.abstract String
Returns all headers as a single string.abstract int
Returns the HTTP status code that is part of this response.abstract String
Returns the HTTP status message text.abstract String
getText()
Returns the text associated with the response.
-
Field Details
-
SC_ACCEPTED
public static final int SC_ACCEPTED- See Also:
-
SC_BAD_GATEWAY
public static final int SC_BAD_GATEWAY- See Also:
-
SC_BAD_REQUEST
public static final int SC_BAD_REQUEST- See Also:
-
SC_CONFLICT
public static final int SC_CONFLICT- See Also:
-
SC_CONTINUE
public static final int SC_CONTINUE- See Also:
-
SC_CREATED
public static final int SC_CREATED- See Also:
-
SC_EXPECTATION_FAILED
public static final int SC_EXPECTATION_FAILED- See Also:
-
SC_FORBIDDEN
public static final int SC_FORBIDDEN- See Also:
-
SC_GATEWAY_TIMEOUT
public static final int SC_GATEWAY_TIMEOUT- See Also:
-
SC_GONE
public static final int SC_GONE- See Also:
-
SC_HTTP_VERSION_NOT_SUPPORTED
public static final int SC_HTTP_VERSION_NOT_SUPPORTED- See Also:
-
SC_INTERNAL_SERVER_ERROR
public static final int SC_INTERNAL_SERVER_ERROR- See Also:
-
SC_LENGTH_REQUIRED
public static final int SC_LENGTH_REQUIRED- See Also:
-
SC_METHOD_NOT_ALLOWED
public static final int SC_METHOD_NOT_ALLOWED- See Also:
-
SC_MOVED_PERMANENTLY
public static final int SC_MOVED_PERMANENTLY- See Also:
-
SC_MOVED_TEMPORARILY
public static final int SC_MOVED_TEMPORARILY- See Also:
-
SC_MULTIPLE_CHOICES
public static final int SC_MULTIPLE_CHOICES- See Also:
-
SC_NO_CONTENT
public static final int SC_NO_CONTENT- See Also:
-
SC_NON_AUTHORITATIVE_INFORMATION
public static final int SC_NON_AUTHORITATIVE_INFORMATION- See Also:
-
SC_NOT_ACCEPTABLE
public static final int SC_NOT_ACCEPTABLE- See Also:
-
SC_NOT_FOUND
public static final int SC_NOT_FOUND- See Also:
-
SC_NOT_IMPLEMENTED
public static final int SC_NOT_IMPLEMENTED- See Also:
-
SC_NOT_MODIFIED
public static final int SC_NOT_MODIFIED- See Also:
-
SC_OK
public static final int SC_OK- See Also:
-
SC_PARTIAL_CONTENT
public static final int SC_PARTIAL_CONTENT- See Also:
-
SC_PAYMENT_REQUIRED
public static final int SC_PAYMENT_REQUIRED- See Also:
-
SC_PRECONDITION_FAILED
public static final int SC_PRECONDITION_FAILED- See Also:
-
SC_PROXY_AUTHENTICATION_REQUIRED
public static final int SC_PROXY_AUTHENTICATION_REQUIRED- See Also:
-
SC_REQUEST_ENTITY_TOO_LARGE
public static final int SC_REQUEST_ENTITY_TOO_LARGE- See Also:
-
SC_REQUESTED_RANGE_NOT_SATISFIABLE
public static final int SC_REQUESTED_RANGE_NOT_SATISFIABLE- See Also:
-
SC_RESET_CONTENT
public static final int SC_RESET_CONTENT- See Also:
-
SC_SEE_OTHER
public static final int SC_SEE_OTHER- See Also:
-
SC_SERVICE_UNAVAILABLE
public static final int SC_SERVICE_UNAVAILABLE- See Also:
-
SC_SWITCHING_PROTOCOLS
public static final int SC_SWITCHING_PROTOCOLS- See Also:
-
SC_TEMPORARY_REDIRECT
public static final int SC_TEMPORARY_REDIRECT- See Also:
-
SC_UNAUTHORIZED
public static final int SC_UNAUTHORIZED- See Also:
-
SC_UNSUPPORTED_MEDIA_TYPE
public static final int SC_UNSUPPORTED_MEDIA_TYPE- See Also:
-
SC_USE_PROXY
public static final int SC_USE_PROXY- See Also:
-
-
Constructor Details
-
Response
public Response()
-
-
Method Details
-
getHeader
Returns the value of the requested header or null if the header was not specified.- Parameters:
header
- the header to query for- Returns:
- the value of response header
- Throws:
IllegalArgumentException
- if the header name is emptyNullPointerException
- if the header name is null
-
getHeaders
Returns an array of HTTP headers associated with this response.- Returns:
- array of HTTP headers; returns zero length array if there are no headers
-
getHeadersAsString
Returns all headers as a single string. The individual headers are delimited by a CR (U+000D) LF (U+000A) pair. An individual header is formatted according to RFC 2616.- Returns:
- all headers as a single string delimited by CRLF pairs
-
getStatusCode
public abstract int getStatusCode()Returns the HTTP status code that is part of this response.The value will be 0 if the request failed (e.g. network error, or the server disallowed the request) or has been aborted (this will generally be the case when leaving the page).
- Returns:
- the HTTP status code or 0
-
getStatusText
Returns the HTTP status message text.- Returns:
- the HTTP status message text
-
getText
Returns the text associated with the response.- Returns:
- the response text
-