HTTP get 方法返回 http 主机连接异常

发布于 2024-09-12 05:54:53 字数 174 浏览 7 评论 0原文

我正在尝试使用 httpclient 和 httpget 从 URI 获取响应。当我尝试执行 httpclient.execute 方法时,它给了我 http 主机连接异常。但是,当我将相同的 URI 作为输入流传递给 XML 解析代码时,代码可以正常工作。 有人对这个问题有任何想法吗? 提前感谢帮助

vaibhav

I am trying to get the response from a URI using httpclient and httpget. when i am trying to execute the httpclient.execute method it is giving me the http host connect exception. However when i am passing the same URI to the XML parsing code as inputstream the code works fine.
Does someone has any idea on the problem..
Help appreciated in advance

vaibhav

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

童话里做英雄 2024-09-19 05:54:53

你是在代理后面吗? HttpClient 库可能使用与您正在使用的 XML 库不同的方式来配置代理。以下链接可能有用,具体取决于您使用的 HttpClient 版本。

Are you behind a proxy? The HttpClient library probably uses a different way to configure the proxy than the XML library you are using. The following links may be useful, depending on the version of HttpClient you are using.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文