问题描述
我正在使用python的 urllib 将POST请求发送到PHP程序:
I am using python's urllib to send POST request to a PHP program:
phonehome_url = "example.com/phonehome.php"
urllib.urlopen(phonehome_url, site_info);
site_info是这样的数组:[{'name': 'Technische Universitaet Muenchen', 'url': 'http://www.tum.de', 'site_id': 11599, 'longitude': 11.5669, 'login_base': 'tumple', 'latitude': 48.1493}]
.
site_info is an array like this: [{'name': 'Technische Universitaet Muenchen', 'url': 'http://www.tum.de', 'site_id': 11599, 'longitude': 11.5669, 'login_base': 'tumple', 'latitude': 48.1493}]
.
但是phonehome.php
接收到空的$_POST
.我的网络服务器是nginx.任何的想法?我已经尝试过修改fastcgi-params,不起作用.
But the phonehome.php
receives empty $_POST
. My webserver is nginx.Any idea? I already tried modify the fastcgi-params, doesn't work.
我在Apache上尝试了同样的方法而没有这个问题.
And I tried the same thing on Apache without this problem.
推荐答案
我没弄错,但是通常请求类型是GET. http://docs.python.org/2/library/urllib.html
Did I get it right, but normally the request type is GET. http://docs.python.org/2/library/urllib.html
这篇关于$ _POST在Nginx中为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!