Thursday 31 January 2013

RequestBuilder in Gwt

import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.http.client.URL;

String url="http://restro.example.com/download?id=0.1212123455&name=raja";
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL.encode(url));
try
{
Request request = builder.sendRequest("", new RequestCallback()
{
public void onError(Request request, Throwable exception)
{
Window.alert("Request Builder Failed");
}
public void onResponseReceived(Request request, Response response)
{
Window.alert("Request Builder passed"+response.getStatusCode());
}
});
} catch (RequestException e)
{
e.printStackTrace();
}

2 comments:

  1. Howdy i really liked your site. I found your site while browsing on the web. I came across a way that you can get yourself a Free Wordpress Website.

    ReplyDelete
  2. I have recently started a blog, the info you offer on this website has helped me greatly. Thank you for all of your time & work.

    ReplyDelete