[英]HTTP Response code 403 Issue
I am getting 我正进入(状态
Http 403 code
When I try to access that URL using my application Http 403 code
当我尝试使用我的应用程序访问该URL时
URL url = new URL(path);
url.openStream();
URL url = new URL(downloadURL);
/*URLConnection conn = url.openConnection();
conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2");*/
HttpURLConnection httpcon = (HttpURLConnection) url.openConnection();
httpcon.setRequestProperty("User-Agent","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.102 Safari/537.36");
httpcon.connect();
//url.getFile();
InputStream is = httpcon.getInputStream();
//InputStream is = conn.getInputStream();
But I can open the URL which I am using in my application .. 但是我可以打开我在应用程序中使用的URL。
Can anybody please help 有人可以帮忙吗
I can access that URL In my browser... 我可以在浏览器中访问该URL ...
That URL is from some server(local) not public. 该URL来自某个不公开的服务器(本地)。
URL url = new URL(path);
URLConnection conn = url.openConnection();
conn.getInputStream();
Try this way. 尝试这种方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.