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
});
my api.py like this:
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()
it returns 200 and post nothing.How can I reslove it?