0

Here is My ajax call

$.ajax({
    url:'http://localhost:8081/organizations/',
    data: JSON.stringify({"name":"karthik"}),
    type: 'POST',
    dataType :'json',
    processData : true,

    success: (function(response){ alert("response "+response);}),
    error: (function(err){ console.log(err); }) 
});

In the api, when i tried to print request.data, why i am getting like this {u'{"name":"karthik"}': [u'']}

abpatil
  • 916
  • 16
  • 20
  • Read this question should help you. http://stackoverflow.com/questions/17785592/difference-between-json-stringify-and-json-parse – Mykola Borysyuk Aug 24 '16 at 09:26

1 Answers1

0

Replace below line

success: (function(response){ alert("response "+response);}),

by newone

success: (function(response){ alert(JSON.stringify(response));}),

In your code and then try it will work.

Raghbendra Nayak
  • 1,606
  • 3
  • 22
  • 47