| Refresh | Home EGTry.com

make http request to get text data, such as json, xml, csv formats

http client to get text data, the data url is "json1.txt"

		RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, "/json1.txt");
		try {
		Request request=builder.sendRequest(
			new RequestCallback() {

				public void onResponseReceived(Request request,
						Response response) {
					String content=response.getText();

				public void onError(Request request, Throwable exception) {
					Window.alert("error response: "+exception.getMessage());
		} catch (RequestException e) {
			Window.alert("send request failed: "+e.getMessage());