HttpClient: Target host must not be null, or set in parameters | H3x.no – Tor Henning Uelands blog
If you have the following code failing:
HttpGet httpget = new HttpGet(“www.host.com”);
Then the error is pretty easy to solve:
The problem is that you have not added a protocol to the URL, so change it to:
HttpGet httpget = new HttpGet(“http://www.host.com”);
And then it will work as wanted.
Read full article from HttpClient: Target host must not be null, or set in parameters | H3x.no – Tor Henning Uelands blog
No comments:
Post a Comment