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