Class Response

java.lang.Object
com.google.gwt.http.client.Response
Direct Known Subclasses:
ResponseImpl

public abstract class Response extends Object
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.
<module>
  <!-- other inherited modules, such as com.google.gwt.user.User -->
  <inherits name="com.google.gwt.http.HTTP"/>
  <!-- additional module settings -->
</module>
  • Field Details

  • Constructor Details

    • Response

      public Response()
  • Method Details

    • getHeader

      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
    • getHeaders

      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
    • getHeadersAsString

      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
    • 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

      public abstract String getStatusText()
      Returns the HTTP status message text.
      Returns:
      the HTTP status message text
    • getText

      public abstract String getText()
      Returns the text associated with the response.
      Returns:
      the response text