| |
|
| java.lang.Object com.google.gwt.http.client.RequestBuilder
RequestBuilder | public class RequestBuilder (Code) | | Builder for constructing
com.google.gwt.http.client.Request objects.
By default, this builder is restricted to building HTTP GET and POST requests
due to a bug in Safari's implementation of the XmlHttpRequest
object.
Please see
http://bugs.webkit.org/show_bug.cgi?id=3812 for more details.
Required Module
Modules that use this class should inherit
com.google.gwt.http.HTTP .
|
Inner Class :final public static class Method | |
Field Summary | |
final public static Method | GET Specifies that the HTTP GET method should be used. | final public static Method | POST Specifies that the HTTP POST method should be used. |
Constructor Summary | |
public | RequestBuilder(Method httpMethod, String url) Creates a builder using the parameters for configuration.
Parameters: httpMethod - HTTP method to use for the request Parameters: url - URL that has already has already been encoded. | protected | RequestBuilder(String httpMethod, String url) Creates a builder using the parameters values for configuration.
Parameters: httpMethod - HTTP method to use for the request Parameters: url - URL that has already has already been URL encoded. |
Method Summary | |
public Request | sendRequest(String requestData, RequestCallback callback) Sends an HTTP request based on the current builder configuration. | public void | setHeader(String header, String value) Sets a request header with the given name and value. | public void | setPassword(String password) Sets the password to use in the request URL. | public void | setTimeoutMillis(int timeoutMillis) Sets the number of milliseconds to wait for a request to complete. | public void | setUser(String user) Sets the user name that will be used in the request URL. |
GET | final public static Method GET(Code) | | Specifies that the HTTP GET method should be used.
|
POST | final public static Method POST(Code) | | Specifies that the HTTP POST method should be used.
|
sendRequest | public Request sendRequest(String requestData, RequestCallback callback) throws RequestException(Code) | | Sends an HTTP request based on the current builder configuration. If no
request headers have been set, the header "Content-Type" will be used with
a value of "text/plain; charset=utf-8".
Parameters: requestData - the data to send as part of the request Parameters: callback - the response handler to be notified when the request failsor completes a Request object that can be used to track the request |
setHeader | public void setHeader(String header, String value)(Code) | | Sets a request header with the given name and value. If a header with the
specified name has already been set then the new value overwrites the
current value.
Parameters: header - the name of the header Parameters: value - the value of the header throws: NullPointerException - if header or value are null throws: IllegalArgumentException - if header or value are the empty string |
setPassword | public void setPassword(String password)(Code) | | Sets the password to use in the request URL. This is ignored if there is no
user specified.
Parameters: password - password to use in the request URL throws: IllegalArgumentException - if the password is empty throws: NullPointerException - if the password is null |
|
|
|