Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Target host must not be null, or set in parameters

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.

Part of my 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?

like image 463
Ama Avatar asked Jan 06 '12 14:01

Ama


2 Answers

It should be

HttpPost post = new HttpPost("http://www.infocreation.something.xml");
like image 104
coder_For_Life22 Avatar answered Nov 03 '22 09:11

coder_For_Life22


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.

like image 7
Ama Avatar answered Nov 03 '22 10:11

Ama