我使用java GWT开发了我的应用程序,并在Google应用程序引擎上部署了我的应用程序。我访问的网址是sample.myappid.appspot.com我想打电话给通过这个代码的网址,所以我做了这样的: -如何从谷歌应用程序引擎调用我的应用程序url
URL url;
try {
url = new URL("http://sample.myappid.appspot.com");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setRequestMethod("POST");
if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {
// OK
logger.log(Level.SEVERE,"Done okkkkkk");
} else {
// Server returned HTTP error code.
logger.log(Level.SEVERE,"Erorrrrrrr");
}
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
这不是叫我的网址。所以任何其他解决方案如何使用代码调用我的URL。
任何帮助?
我想作者问了关于GWT,所以这将是客户端请求,而不是从服务器 –
@IgorArtamonov Hm,可能。我的回应是基于“使用Java GWT开发我的应用程序,并且我在谷歌应用程序引擎上部署了我的应用程序”。如果确实是客户端,答案仍然适用于服务器端实现(递归循环同样可以从外部请求触发)。 –