下面是javascript代码:
$.ajax({
type: 'POST',
url: '/vote_selection/vote/',
dataType:'json',
data: {'message':'123'},
success:function(data){
alert(data);
}
});
下面是python代码:
def vote_select(request):
print "1"
print request
print request.method
print request.POST
return HttpResponse("1",mimetype='text/plain')
输出是
1
, POST:, ... 'REQUEST_METHOD': 'GET', ..
得到
[29/Sep/2012 22:38:49]“GET /vote_selection/vote/HTTP/1.0”200 1
为什么方法会变成 GET,为什么 GET 或 POST 中都没有参数?
谢谢!