[Fixed]-Proper JSON not received in Django Request

1👍

You need to use JSON.stringify(arr) while parsing data

$(document).ready(function() {       
    $("#button").click(function() {
          $.ajax({
            url:"http://10.124.92.208:8000/customer/retrieve_info",
            crossDomain:true,
            data: JSON.stringify({"order_clientId" : 114, "order_start_dt" : "2016-01-01T21:25:22", "order_end_dt" : "2016-01-05T21:25:22"}), 
            contentType: 'application/json; charset=utf-8',
            type:"POST",
            dataType:"json",
          })
          .done(function(json){
            alert(json);
          });
    });

});

Leave a comment