public void doPost(String targetUri, String data, IResponseHandler responseHandler) { String realUrl = null; 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)); }
public void doGet(String targetUri, IResponseHandler responseHandler, boolean raw) { String realUrl = null; 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); } // DesktopManager.getInstance().getLogger().logInfo(realUrl); HTTPRequest.asyncGet(realUrl, new ServiceResponseHandler(responseHandler, raw)); }