Example usage for com.google.gwt.http.client RequestBuilder POST

List of usage examples for com.google.gwt.http.client RequestBuilder POST

Introduction

In this page you can find the example usage for com.google.gwt.http.client RequestBuilder POST.

Prototype

Method POST

To view the source code for com.google.gwt.http.client RequestBuilder POST.

Click Source Link

Document

Specifies that the HTTP POST method should be used.

Usage

From source file:org.xmlsh.jsonxmlspeed.client.RunAllDialog.java

License:BSD License

public void sendResults() {
    // Set the dialog box's caption.
    setText("Sending Results ...");

    // Enable animation.
    setAnimationEnabled(true);//w  ww.ja v a2 s.c o m

    // Enable glass background.
    setGlassEnabled(true);

    RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, "/cgi-bin/speedresults");
    String data = dataFilePanel.buildResults();
    try {

        Request request = builder.sendRequest(data, new RequestCallback() {
            public void onError(Request request, Throwable exception) {
                Window.alert(exception.getLocalizedMessage());
            }

            @Override
            public void onResponseReceived(Request request, Response response) {
                RunAllDialog.this.setText("Complete: " + response.getText());
                runForm.doneSubmit();
            }
        });
    } catch (RequestException e) {
        Window.alert(e.getLocalizedMessage());
    }
}

From source file:org.xwiki.gwt.user.client.ui.rta.Reloader.java

License:Open Source License

/**
 * Creates a new reloader that makes requests to the specified URL and uses the response to reset the content of the
 * given rich text area.//from   www  .  j a va  2  s  . c o m
 * 
 * @param rta the rich text area that needs to be reloaded
 * @param url the URL to get the content from; note that this URL must obey the same-origin policy
 */
public Reloader(RichTextArea rta, String url) {
    this.rta = rta;

    requestBuilder = new RequestBuilder(RequestBuilder.POST, url);
    // NOTE: We must specify the character set because otherwise the server side will use the configured encoding.
    requestBuilder.setHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
}

From source file:pt.ist.processpedia.client.service.http.PostService.java

License:Open Source License

public PostService(String url) {
    super(RequestBuilder.POST, url);
}

From source file:pt.ist.processpedia.client.service.http.PostService.java

License:Open Source License

public PostService(String url, Translator translator) {
    super(RequestBuilder.POST, url, translator);
}

From source file:rocket.remoting.client.support.rpc.JavaRpcServiceMethodInvoker.java

License:Apache License

/**
 * Java rpcs use ajax and are always POSTS...
 */
protected Method getRequestMethod() {
    return RequestBuilder.POST;
}

From source file:rocket.remoting.client.support.rpc.JsonRpcServiceInvoker.java

License:Apache License

@Override
Method getRequestMethod() {
    return RequestBuilder.POST;
}

From source file:rocket.remoting.client.support.rpc.PostJsonServiceMethodInvoker.java

License:Apache License

@Override
final protected RequestBuilder.Method getRequestMethod() {
    return RequestBuilder.POST;
}

From source file:rpc.client.HTTPClient.java

License:Open Source License

public HTTPClient(Serializer serializer, String url) {
    super(serializer);

    builder = new RequestBuilder(RequestBuilder.POST, url);
}

From source file:rtdc.web.client.impl.GwtHttpRequest.java

License:Open Source License

public GwtHttpRequest(String url, RequestMethod requestMethod) {
    RequestBuilder.Method method = null;
    switch (requestMethod) {
    case GET:// w  w w . ja va 2 s .  c  o m
        method = RequestBuilder.GET;
        break;
    case POST:
        method = RequestBuilder.POST;
        break;
    case PUT:
        method = RequestBuilder.PUT;
        break;
    case DELETE:
        method = RequestBuilder.DELETE;
        break;
    }
    builder = new RequestBuilder(method, url);
}

From source file:sf.wicklet.gwt.client.ajax.WickletAjax.java

License:Apache License

public static void ajax(final String url, final String data, final IWickletAjaxCallback callback) {
    ajax(RequestBuilder.POST, url, data, callback);
}