gpt4 book ai didi

android - 我如何从安卓手机接收网站的值(value)

转载 作者:行者123 更新时间:2023-11-30 03:37:15 26 4
gpt4 key购买 nike

我正在将值从 Android 手机发送到网站。该网站是通过一些免费资源在线注册的。

代码是,

public class HttpStorage extends AsyncTask{
protected void onPreExecute() {
super.onPreExecute();
}
protected void onPostExecute(Integer result) {
}

public void postData() {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new
HttpPost("http://pavithrakrishnakumar.simplesite.com/");

try {
List <NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("IDToken1", "username"));
nameValuePairs.add(new BasicNameValuePair("IDToken2", "password"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
} catch (ClientProtocolException e) {
} catch (IOException e) {
}
}

@Override
protected Object doInBackground(Object... arg0) {
postData();
return null;
}
}

现在我在 android 端没有收到任何错误。如何检索上述站点中的值

最佳答案

<?php
$IDToken1 = $_POST['IDToken1'];
$IDToken2 = $_POST['IDToken2'];

这就是您如何从该脚本中的发布请求中检索数据..

关于android - 我如何从安卓手机接收网站的值(value),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16475133/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com