Reputation: 24492
I've been trying to create DefaultHttpClient object
with:
HttpClient client = new DefaultHttpClient();
but I'm unable to find this class can't be resolved in my Android Studio. After googling this class, the first result shows the following URL:Link
and it's 404: not found page.
Does anyone know how I can use this function and similar function such as HttpGet?
Upvotes: 2
Views: 52
Reputation: 352
Use urlconnection. If i remember correctly, defaulthttpclient is deprecated.
URL url = new URL("http://stackoverflow.com");
URLConnection conn = url.openConnection();
InputStream in = new BufferedInputStream(conn.getInputStream());
Upvotes: 1