The target server failed to respond 錯誤解決


一個很正常的網站,使用httpclient提交怎么都會有問題

     HttpPost httppost = new HttpPost();
        // HttpGet httppost = new HttpGet();
        URI uri = new URI(post);
        httppost.setURI(uri);
        HttpClient httpclient = new DefaultHttpClient();
        String html = "";
        HttpResponse response = httpclient.execute(httppost);
        System.out.println(response.getStatusLine());

總是報那個錯誤org.apache.http.NoHttpResponseException:

                        The target server failed to respond

本來打算讀讀源碼看看到底什么問題,突然想把post換成get方式再試試,結果完全無問題了。。。。哪位有興趣讀了源碼可以告訴我下原因


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM