i'm trying to make http request in android
but i got these errors
- HttpClient cannot be resolved to a type
- DefaultHttpClient cannot be resolved to a type
screenshot:
Delete this line:
import org.apache.http.*;
And Add these:
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
This solved the problem for me: click on the project folder, then alt+Enter, go to Java Build Path, Libraries, click on add external Jar, add the .jar file located at "sdk\platforms\android-23\optional\org.apache.http.legacy.jar", go to order and export and click on org.apache.http.legacy.jar, click OK and it will be solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With