Example usage for com.google.gwt.user.client HTTPRequest asyncPost

List of usage examples for com.google.gwt.user.client HTTPRequest asyncPost

Introduction

In this page you can find the example usage for com.google.gwt.user.client HTTPRequest asyncPost.

Prototype

public static boolean asyncPost(String url, String postData, ResponseTextHandler handler) 

Source Link

Document

Makes an asynchronous HTTP POST to a remote server.

Usage

From source file:com.dimdim.conference.ui.json.client.ServerAvailabilityChecker.java

License:Open Source License

private void runCheck() {
    if (handler != null) {
        try {/*  w w  w .  java 2 s  . c  om*/
            if (!HTTPRequest.asyncPost(url + "&cflag=" + (getClientGUID()), "a=b", handler)) {
                //   Failure
                checkResult(false);
            }
        } catch (Exception e) {
            //   Failure to contact the server. Increate
            checkResult(false);
        }
    }
}

From source file:com.dimdim.ui.common.client.json.JSONReturnUrlReader.java

License:Open Source License

public boolean doPostURL(String data) {
    boolean b = true;
    if (handler != null) {
        JSONReturnUrlReader.busy = true;
        try {//from  ww w .j  a va  2s . c  o m
            if (!HTTPRequest.asyncPost(url + "&cflag=" + (getClientGUID()), data, handler)) {
                b = false;
            }
        } catch (Exception e) {
            JSONReturnUrlReader.errorCount++;
            b = false;
        }
        JSONReturnUrlReader.busy = false;
        JSONReturnUrlReader.errorCount = 0;
    }
    return b;
}

From source file:com.dimdim.ui.common.client.json.JSONurlReader.java

License:Open Source License

public boolean doPostURL(String data) {
    boolean b = true;
    if (handler != null) {
        JSONurlReader.busy = true;/* ww  w  .j av a 2  s  .  c o m*/
        try {
            if (!HTTPRequest.asyncPost(url + "&cflag=" + (getClientGUID()), data, handler)) {
                b = false;
            }
        } catch (Exception e) {
            JSONurlReader.errorCount++;
            b = false;
        }
        JSONurlReader.busy = false;
    }
    return b;
}

From source file:org.gwm.splice.client.service.GenericRemoteService.java

License:Apache License

public void doPost(String targetUri, String data, IResponseHandler responseHandler) {
    String realUrl = null;/*from   ww  w  .  j a  v a  2  s  .  co  m*/
    if (!GWT.isScript()) {
        // if running in hosted mode, we need to send request to proxy servlet,
        // encoding the "real" target url in the "targeturl" parameter (which needs to be encoded)
        realUrl = GWT.getModuleBaseURL() + "/proxy?targeturl="
                + encodeUrl(hostedModeTargetBaseUrl + "/" + targetUri);
    } else {
        realUrl = buildFullUrl(targetUri);
    }

    HTTPRequest.asyncPost(realUrl, data, new ServiceResponseHandler(responseHandler));
}