-1

Warnings for HttpClient,HttpGet().
The code is running but it is not getting any response from the Esp8266(I have used Esp8266 as a server in my application).

Is it related to the warnings of HttpClient or HttpGet() as shown in the image or related to the Esp8266 coding?
Please guide!

enter image description here

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
DevSuyog
  • 3
  • 2

1 Answers1

1

HTTPClient is deprecated since API 22. You can try using HttpURLConnection instead.

URL url = new URL(urlString);
    HttpURLConnection connection = (HttpURLConnection)url.openConnection();
    connection.setRequestProperty("User-Agent", "");
    connection.setRequestMethod("POST");
    connection.setDoInput(true);
    connection.connect();

More info in this answer : https://stackoverflow.com/a/29889139/5040796