如何将数据发布到远程服务器中的Andr​​oid应用程序

问题描述:

可能重复:
  如何做一个HTTP张贴在Android的?

我想这两个值发送到服务器,说 HTTP://localhost/twoVal.php ,这将进一步处理该信息。

I want to send the two values to a server ,say http://localhost/twoVal.php, which will further process the information.

例如,

我已经得到了VAL1 = 12和val2 = 13 我要发布这些数据,以上面提到的网址。 (可能是某些URL不需要本地主机),怎么办呢? 此外,需要发送作为HTTP标头(POST)及一部分的数据;不是作为查询参数。

i have got the val1 = 12 and val2 = 13 i want to post these data to above mentioned URL. (May be some URL need not be localhost) how to do it? Also, data needs to be sent as part of HTTP header (POST) & not as query parameters.

你甚至试图寻找答案?

  • Http Post in android
  • Android, sending XML via HTTP POST (SOAP)
  • Http post in Java
  • Http post in Java with UrlConnection
  • HttpClient android docs