在浏览器端:
<script src="jquery.json.js"></script> ... $.ajax({ url:url, type: "POST", dataType: 'json', contentType: 'application/json', data: $.toJSON(post_data), success: function(result,status,xhr){ }, error: function(xhr,status,error) { }, });
server端:
from django.utils import simplejson def info_setter_json(request): if request.method == 'POST': json_data = simplejson.loads(request.raw_post_data)