Class HTTPRequest

public class HTTPRequest
extends Object
This class allows you to make asynchronous HTTP requests to the originating server.

Methods

asyncGet(String, ResponseTextHandler)Makes an asynchronous HTTP GET to a remote server.
asyncGet(String, String, String, ResponseTextHandler)Makes an asynchronous HTTP GET to a remote server.
asyncPost(String, String, ResponseTextHandler)Makes an asynchronous HTTP POST to a remote server.
asyncPost(String, String, String, String, ResponseTextHandler)Makes an asynchronous HTTP POST to a remote server.

Method Detail

asyncGet

public static boolean asyncGet(String url, ResponseTextHandler handler)
Makes an asynchronous HTTP GET to a remote server.

Parameters

url
the absolute url to GET
handler
the response handler to be notified when either the request fails, or is completed successfully

Return Value

false if the invocation fails to issue

asyncGet

public static boolean asyncGet(String user, String pwd, String url, ResponseTextHandler handler)
Makes an asynchronous HTTP GET to a remote server.

Parameters

user
pwd
url
the absolute url to GET
handler
the response handler to be notified when either the request fails, or is completed successfully

Return Value

false if the invocation fails to issue

asyncPost

public static boolean asyncPost(String url, String postData, ResponseTextHandler handler)
Makes an asynchronous HTTP POST to a remote server.

Parameters

url
the absolute url to which the POST data is delivered
postData
the data to post
handler
the response handler to be notified when either the request fails, or is completed successfully

Return Value

false if the invocation fails to issue

asyncPost

public static boolean asyncPost(String user, String pwd, String url, String postData, ResponseTextHandler handler)
Makes an asynchronous HTTP POST to a remote server.

Parameters

user
pwd
url
the absolute url to which the POST data is delivered
postData
the data to post
handler
the response handler to be notified when either the request fails, or is completed successfully

Return Value

false if the invocation fails to issue