POST array empty on jQuery AJAX call

后端 未结 2 1423
孤城傲影
孤城傲影 2021-01-22 10:18

I hesitate to ask, as there are numerous other posts on this topic (one and two for example), but none of the solutions in those posts seem to apply to me.

I am trying t

相关标签:
2条回答
  • 2021-01-22 10:47

    Try in PHP as below (When request is an application/json, then you will not get data into $_POST)

    var_dump(json_decode(file_get_contents("php://input")));
    
    0 讨论(0)
  • 2021-01-22 10:57

    Try this May be it will work for you

     $.ajax({
    type: 'POST',
    url:"controller.php?a=update-player",
    data: data_json=JSON.stringify(playerinfo),
    success: function (data){
    },
    }); 
    
    0 讨论(0)
提交回复
热议问题