I use Tastypie for Django s API. but it returns error. my code is bellow.
$.ajax({
type : "POST",
url : "http://192.168.1.130:8000/api/user/author/",
data : {"first_name": "111","second_name": "222"} ,
success: function(){
alert( Submit Success )
},
dataType : json ,
contentType : application/json ,
processData: false
});
我的pi.py像这样:
class AuthorResource(ModelResource):
class Meta:
queryset = Author.objects.all()
resource_name = author
fields = [ first_name , last_name ]
filtering = {
first_name : ALL,
}
authentication = Authentication()
authorization = Authorization()
返回200, 寄什么也没有。 我怎么能重新爱它呢?