Server returned HTTP response code: 502 for URL????
1: URL url = new URL("http://...");
2: URLConnection conn = url.openConnection();
3: conn.connect();
4: InputStream is = null;
5: try {
6: is = conn.getInputStream();
7: } catch (IOException e) {
8: e.printStackTrace();
9: }
程序执行到上面代码事报错,提示一下错误:
java.io.IOException: Server returned HTTP response code: 502 for URL: http://...
提示是在 第六行 is = conn.getInputStream(); 的错误
502 Bad Gateway 服务器作为网关或者代理时,为了完成请求访问下一个服务器,但该服务器返回了非法的应答。
一开始还好使,在昨天突然就出现这问题了
访问其他的url,没有错误,这点说明代码应该没问题
用asp和vb.net获取我这个会报错的url也没问题!~
哪位知道怎么解决????????