1

我将字符串值发送到服务器上的 php 文件,如下所示:

    // Create a new HttpClient and Post Header
    HttpClient httpclient = new DefaultHttpClient();
    HttpPost httppost = new HttpPost("serverurl");
    Log.d("httppost..", httppost + "");
    try {
        List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
        nameValuePairs.add(new BasicNameValuePair("data", dataCount + ""));
        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
        HttpResponse response = httpclient.execute(httppost);
    }

但是,我没有看到我从应用程序发送的任何数据。谢谢你的帮助。

4

0 回答 0