HTTP get 方法返回 http 主机连接异常
我正在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你是在代理后面吗? 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.