目标主机不能为空,或参数设置 [英] Target host must not be null, or set in parameters

查看:313
本文介绍了目标主机不能为空,或参数设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到这个错误目标主机不能为空,或参数设置。我的清单文件有上网权限集,我已经把HTTP://我的网址了。它仍然给出了同样的错误。我的网址没有一个WWW。连接到它。

I get this error "Target host must not be null, or set in parameters". My manifest file has internet permission set, and I have put 'http://' before my Url. It still gives the same error. My URL does not have a 'www.' attached to it.

我的code部分:

HttpPost post = new HttpPost("http://infocreation.something_something1.xml");

我的清单的一部分是象下面这样:

Part of my manifest is like below:

<uses-permission android:name="android.permission.INTERNET/>

现在我该怎么办?

What do I do now?

推荐答案

所以,我更换了网址,几乎相同的URL,只是没有下划线和工作。我进一步搜索来实现(例如<一个href="http://stackoverflow.com/questions/5446578/using-openstream-with-a-url-that-has-a-subdomain-with-an-underscore-in-it-return">here) 的,与下划线(_)的网址是无效的,但特定的URL可能工作。感谢您的帮助。

So I replaced the URL, with almost the same URL, except without the underscore and that worked. I realized from further searches (for example here) that URLs with _(underscore) are not valid, although that particular URL may work. Thanks for all your help.

这篇关于目标主机不能为空,或参数设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆