I'm trying to send array as a parameter to the api which is using python and django
framework.
Here's my client side code that is being used to access the api
:
$.ajax(
type: 'POST',
url: 'http://example.com/api/users',
data: {user:{name:'Rohit Khatri', age:20, father_name:'S.K'},type:'info'},
complete: function(response) {
console.log(response);
}
);
Here's the view where I'm trying to access the request parameters
def get_users(request):
print(request.POST.get('ids'))
and when I try to access ids
parameter, It gives None.
If anyone has faced the same problem, please help me.