$http.post not working in AngularJS

后端 未结 4 1604
别那么骄傲
别那么骄傲 2021-01-12 03:09

When I use $http.get my code works, but if I use $http.post, I never get the parameters to the request .php file.

This is Service function:

         


        
4条回答
  •  太阳男子
    2021-01-12 03:55

    I faced the same issue but I found that there is no issue in angular http post method, issue is there where I am trying to get post data.

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

    I used this code to get the posted data from angular and its works like a charm

提交回复
热议问题