我的checkUpdate方法无法从网站读取基本文本文件。
这是代码:
public String checkUpdate()
{
Logger logger = getLogger();
try {
HttpURLConnection con = (HttpURLConnection) new URL(
"http://www.spiromarshes.com/HighRollerVersion.txt").openConnection();
con.setDoOutput(true);
con.setRequestMethod("POST");
String version = new BufferedReader(new InputStreamReader(
con.getInputStream())).readLine();
if (version.length() <= 7) {
return version;
}
} catch (Exception ex) {
System.out.println(ex);
}
return null;
}
它只是给我错误:java.io.IOException:服务器返回HTTP响应代码:403为URL:http://www.spiromarshes.com/HighRollerVersion.txt