Target host must not be null, or set in parameters

后端 未结 3 627
清酒与你
清酒与你 2020-12-07 00:58

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 giv

3条回答
  •  攒了一身酷
    2020-12-07 01:39

    Are you putting a real and working url inot the HttpPost constructor?

    Anyway this is your solution:

    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.

    Source: h3x.no

提交回复
热议问题