AngularJs $http.post() does not send data

前端 未结 30 1772
我在风中等你
我在风中等你 2020-11-22 02:51

Could anyone tell me why the following statement does not send the post data to the designated url? The url is called but on the server when I print $_POST - I get an empty

30条回答
  •  长情又很酷
    2020-11-22 03:23

    If your using PHP this is a easy way to access an array in PHP from an AngularJS POST.

    $params = json_decode(file_get_contents('php://input'),true);
    

提交回复
热议问题