Make an HTTP request with android

后端 未结 12 1306
时光取名叫无心
时光取名叫无心 2020-11-21 06:38

I have searched everywhere but I couldn\'t find my answer, is there a way to make a simple HTTP request? I want to request a PHP page / script on one of my websites but I do

12条回答
  •  误落风尘
    2020-11-21 07:28

    unless you have an explicit reason to choose the Apache HttpClient, you should prefer java.net.URLConnection. you can find plenty of examples of how to use it on the web.

    we've also improved the Android documentation since your original post: http://developer.android.com/reference/java/net/HttpURLConnection.html

    and we've talked about the trade-offs on the official blog: http://android-developers.blogspot.com/2011/09/androids-http-clients.html

提交回复
热议问题