The target server failed to respond 错误解决

前提是你 提交于 2020-02-25 16:51:57

一个很正常的网站,使用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方式再试试,结果完全无问题了。。。。哪位有兴趣读了源码可以告诉我下原因

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!