01: /*
02: * Copyright 2007 Google Inc.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package com.google.gwt.user.client;
17:
18: import com.google.gwt.core.client.GWT;
19: import com.google.gwt.user.client.impl.HTTPRequestImpl;
20:
21: /**
22: * This class allows you to make asynchronous HTTP requests to the originating
23: * server.
24: *
25: * @deprecated As of GWT 1.5, replaced by
26: * {@link com.google.gwt.http.client.RequestBuilder RequestBuilder}.
27: */
28: @Deprecated
29: public class HTTPRequest {
30:
31: private static final HTTPRequestImpl httpRequest = GWT
32: .create(HTTPRequestImpl.class);
33:
34: /**
35: * Makes an asynchronous HTTP GET to a remote server.
36: *
37: * @param url the absolute url to GET
38: * @param handler the response handler to be notified when either the request
39: * fails, or is completed successfully
40: * @return <code>false</code> if the invocation fails to issue
41: */
42: public static boolean asyncGet(String url,
43: ResponseTextHandler handler) {
44: return httpRequest.asyncGet(url, handler);
45: }
46:
47: /**
48: * Makes an asynchronous HTTP GET to a remote server.
49: *
50: * @param url the absolute url to GET
51: * @param handler the response handler to be notified when either the request
52: * fails, or is completed successfully
53: * @return <code>false</code> if the invocation fails to issue
54: */
55: public static boolean asyncGet(String user, String pwd, String url,
56: ResponseTextHandler handler) {
57: return httpRequest.asyncGet(user, pwd, url, handler);
58: }
59:
60: /**
61: * Makes an asynchronous HTTP POST to a remote server.
62: *
63: * @param url the absolute url to which the POST data is delivered
64: * @param postData the data to post
65: * @param handler the response handler to be notified when either the request
66: * fails, or is completed successfully
67: * @return <code>false</code> if the invocation fails to issue
68: */
69: public static boolean asyncPost(String url, String postData,
70: ResponseTextHandler handler) {
71: return httpRequest.asyncPost(url, postData, handler);
72: }
73:
74: /**
75: * Makes an asynchronous HTTP POST to a remote server.
76: *
77: * @param url the absolute url to which the POST data is delivered
78: * @param postData the data to post
79: * @param handler the response handler to be notified when either the request
80: * fails, or is completed successfully
81: * @return <code>false</code> if the invocation fails to issue
82: */
83: public static boolean asyncPost(String user, String pwd,
84: String url, String postData, ResponseTextHandler handler) {
85: return httpRequest.asyncPost(user, pwd, url, postData, handler);
86: }
87: }
|