試圖訪問http://forum.worldoftanks.eu/index.php?app=members
使用Apache HttpClient,但始終得到403。任何人都可以幫忙嗎? 被擺弄着這片爲起點:HttpClient拋出403
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpRequestBase method = new HttpGet(theUrl);
String s = httpClient.execute(method, new BasicResponseHandler());
System.out.println(s);
httpClient.getConnectionManager().shutdown();
當我訪問一個網址,我得到「您沒有權限查看會員列表。」這大概是爲什麼你會得到403.你需要提供憑據... –
403意味着未經授權訪問服務器。你需要一個有效的憑據來訪問鏈接 –