public abstract class

Response

extends Object
java.lang.Object
   ↳ com.google.gwt.http.client.Response

Class Overview

Wrapper which provides access to the components of an HTTP response.

Required Module

Modules that use this class should inherit com.google.gwt.http.HTTP. {@gwt.include com/google/gwt/examples/http/InheritsExample.gwt.xml}

Summary

Constants
int SC_ACCEPTED
int SC_BAD_GATEWAY
int SC_BAD_REQUEST
int SC_CONFLICT
int SC_CONTINUE
int SC_CREATED
int SC_EXPECTATION_FAILED
int SC_FORBIDDEN
int SC_GATEWAY_TIMEOUT
int SC_GONE
int SC_HTTP_VERSION_NOT_SUPPORTED
int SC_INTERNAL_SERVER_ERROR
int SC_LENGTH_REQUIRED
int SC_METHOD_NOT_ALLOWED
int SC_MOVED_PERMANENTLY
int SC_MOVED_TEMPORARILY
int SC_MULTIPLE_CHOICES
int SC_NON_AUTHORITATIVE_INFORMATION
int SC_NOT_ACCEPTABLE
int SC_NOT_FOUND
int SC_NOT_IMPLEMENTED
int SC_NOT_MODIFIED
int SC_NO_CONTENT
int SC_OK
int SC_PARTIAL_CONTENT
int SC_PAYMENT_REQUIRED
int SC_PRECONDITION_FAILED
int SC_PROXY_AUTHENTICATION_REQUIRED
int SC_REQUESTED_RANGE_NOT_SATISFIABLE
int SC_REQUEST_ENTITY_TOO_LARGE
int SC_RESET_CONTENT
int SC_SEE_OTHER
int SC_SERVICE_UNAVAILABLE
int SC_SWITCHING_PROTOCOLS
int SC_TEMPORARY_REDIRECT
int SC_UNAUTHORIZED
int SC_UNSUPPORTED_MEDIA_TYPE
int SC_USE_PROXY
Public Constructors
Response()
Public Methods
abstract String getHeader(String header)
Returns the value of the requested header or null if the header was not specified.
abstract Header[] getHeaders()
Returns an array of HTTP headers associated with this response.
abstract String getHeadersAsString()
Returns all headers as a single string.
abstract int getStatusCode()
Returns the HTTP status code that is part of this response.
abstract String getStatusText()
Returns the HTTP status message text.
abstract String getText()
Returns the text associated with the response.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int SC_ACCEPTED

Constant Value: 202 (0x000000ca)

public static final int SC_BAD_GATEWAY

Constant Value: 502 (0x000001f6)

public static final int SC_BAD_REQUEST

Constant Value: 400 (0x00000190)

public static final int SC_CONFLICT

Constant Value: 409 (0x00000199)

public static final int SC_CONTINUE

Constant Value: 100 (0x00000064)

public static final int SC_CREATED

Constant Value: 201 (0x000000c9)

public static final int SC_EXPECTATION_FAILED

Constant Value: 417 (0x000001a1)

public static final int SC_FORBIDDEN

Constant Value: 403 (0x00000193)

public static final int SC_GATEWAY_TIMEOUT

Constant Value: 405 (0x00000195)

public static final int SC_GONE

Constant Value: 410 (0x0000019a)

public static final int SC_HTTP_VERSION_NOT_SUPPORTED

Constant Value: 505 (0x000001f9)

public static final int SC_INTERNAL_SERVER_ERROR

Constant Value: 500 (0x000001f4)

public static final int SC_LENGTH_REQUIRED

Constant Value: 411 (0x0000019b)

public static final int SC_METHOD_NOT_ALLOWED

Constant Value: 405 (0x00000195)

public static final int SC_MOVED_PERMANENTLY

Constant Value: 301 (0x0000012d)

public static final int SC_MOVED_TEMPORARILY

Constant Value: 302 (0x0000012e)

public static final int SC_MULTIPLE_CHOICES

Constant Value: 300 (0x0000012c)

public static final int SC_NON_AUTHORITATIVE_INFORMATION

Constant Value: 203 (0x000000cb)

public static final int SC_NOT_ACCEPTABLE

Constant Value: 406 (0x00000196)

public static final int SC_NOT_FOUND

Constant Value: 404 (0x00000194)

public static final int SC_NOT_IMPLEMENTED

Constant Value: 501 (0x000001f5)

public static final int SC_NOT_MODIFIED

Constant Value: 304 (0x00000130)

public static final int SC_NO_CONTENT

Constant Value: 204 (0x000000cc)

public static final int SC_OK

Constant Value: 200 (0x000000c8)

public static final int SC_PARTIAL_CONTENT

Constant Value: 206 (0x000000ce)

public static final int SC_PAYMENT_REQUIRED

Constant Value: 402 (0x00000192)

public static final int SC_PRECONDITION_FAILED

Constant Value: 412 (0x0000019c)

public static final int SC_PROXY_AUTHENTICATION_REQUIRED

Constant Value: 407 (0x00000197)

public static final int SC_REQUESTED_RANGE_NOT_SATISFIABLE

Constant Value: 416 (0x000001a0)

public static final int SC_REQUEST_ENTITY_TOO_LARGE

Constant Value: 413 (0x0000019d)

public static final int SC_RESET_CONTENT

Constant Value: 205 (0x000000cd)

public static final int SC_SEE_OTHER

Constant Value: 303 (0x0000012f)

public static final int SC_SERVICE_UNAVAILABLE

Constant Value: 503 (0x000001f7)

public static final int SC_SWITCHING_PROTOCOLS

Constant Value: 101 (0x00000065)

public static final int SC_TEMPORARY_REDIRECT

Constant Value: 307 (0x00000133)

public static final int SC_UNAUTHORIZED

Constant Value: 401 (0x00000191)

public static final int SC_UNSUPPORTED_MEDIA_TYPE

Constant Value: 415 (0x0000019f)

public static final int SC_USE_PROXY

Constant Value: 305 (0x00000131)

Public Constructors

public Response ()

Public Methods

public abstract String getHeader (String header)

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 empty
NullPointerException if the header name is null

public abstract Header[] 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

public abstract String 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

public abstract int getStatusCode ()

Returns the HTTP status code that is part of this response.

Returns
  • the HTTP status code

public abstract String getStatusText ()

Returns the HTTP status message text.

Returns
  • the HTTP status message text

public abstract String getText ()

Returns the text associated with the response.

Returns
  • the response text