- ajax
$.get(url, function(data){ })
$.POST(url, {'key' : value}, function(data){})
csrf_token处理403问题
{% csrf_token %}
var scrf = $ ('input[name="csrfmiddlewaretoken"]').val()
$.ajax({
url : '',
data: {'key':value},
dataType: 'json',
headers : {'X-CSRFToken' : CSRF},
type: 'POST / PUT / PATCH / DELETE / GET',
success : function(data){
},
error : function(data){
},
})