Codeigniter + Angular Js: How to receive JSON data

后端 未结 5 1133
盖世英雄少女心
盖世英雄少女心 2020-12-16 20:24

This is the situation:

I have a simple app made in Angular JS that comunicate with the server through an API made in codeigniter.

There is a

5条回答
  •  爱一瞬间的悲伤
    2020-12-16 20:26

    thanks for the reply. solution is as follows

    $obj=json_decode(file_get_contents('php://input'));
    

    you can test it by

    print_r(json_decode(file_get_contents('php://input')));
    

提交回复
热议问题