且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android的:不能发送HTTP POST

更新时间:2022-05-05 05:51:11

似乎AndroidHttpClient负责该异常。你的榜样将工作

it seems that AndroidHttpClient is responsible for that exception. Your example will work

  • 如果使用设置互联网persmission的建议
  • 更换AndroidHttpClient'与'DefaultHttpClient
  • 删除行Log.i(HomeActivity.class.toString(),结果);因为结果是空

这是我不明白为什么这个类不工作,excpected,也许有人可以解释。此线程讨论的问题太多,但也没有交代为什么code失败:http://groups.google.de/group/android-developers/browse_thread/thread/cc59efb9475ac557/81116369f2c6bd7a?hl=de&lnk=gst&q=This+thread+forbids+HTTP+requests#81116369f2c6bd7a.

It is not clear to me why this class does not work as excpected, maybe somebody could explain. This thread discussed the problem too but there is also no explaination why the code fails: http://groups.google.de/group/android-developers/browse_thread/thread/cc59efb9475ac557/81116369f2c6bd7a?hl=de&lnk=gst&q=This+thread+forbids+HTTP+requests#81116369f2c6bd7a.