`

Java代码中访问链接提示java.io.IOException: Server returned HTTP response code: 403 for UR

 
阅读更多
URL realURL = null;
realURL = new URL(url);
connection = realURL.openConnection();
connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64)
 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36)");
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics