【发布时间】:2012-02-26 19:47:40
【问题描述】:
在 android 中,我尝试以 json 结构发送到 Web 服务器。它适用于http。但是使用 https,$_POST 值对就消失了。在 PHP 中,var_dump $_POST 返回 array(0) 但是,HttpGet 对 http 和 https 都适用。
MyHttpClient httpClient = new MyHttpClient(context);
HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(new UrlEncodedFormEntity(params));
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
is = httpEntity.getContent();
【问题讨论】:
-
是的,您在 php 中发现了一个其他人从未拥有过的错误 - 或者 - 您的代码。你猜哪个?
-
也许您的 POST 请求以某种方式被重定向,然后丢失了发布数据?
-
如果我设置 HttpClientParams.setRedirecting(params, false);然后页面返回“临时断开的链接已修复”