如何将数据发送到从机器人web服务器发送到、如何将、机器人、服务器

2023-09-12 22:01:33 作者:阳光里的一抹忧伤

我想使用Android的数据发送到我的PHP页面。我该怎么办呢?

I want to send data to my php page using android. How can I do it?

推荐答案

您可以GET或POST请求使用的 AndroidHttpClient :

You can make GET or POST requests using AndroidHttpClient:

创建一个 AndroidHttpClient 执行您的要求。 创建要么是 HTTPGET 或< A HREF =htt​​p://developer.android.com/reference/org/apache/http/client/methods/HttpPost.html相对=nofollow> HttpPost 请求。 使用 setEntity 和 SetHeader可以方法来填充请求。 使用的一个执行你的客户端上的方法,您的要求。 Create an AndroidHttpClient to execute your requests. Create either an HttpGet or HttpPost request. Use setEntity and setHeader methods to populate the request. Use one of the execute methods on your client with your request.

This回答似乎是一个相当完整的code样本。

This answer seems like a fairly complete code sample.