Home >Backend Development >PHP Tutorial >The solution to the problem that angularJS's $http.post cannot get data when it is sent to php

The solution to the problem that angularJS's $http.post cannot get data when it is sent to php

巴扎黑
巴扎黑Original
2016-11-09 13:22:201036browse

$http.post uses postJSON to send data to the php background but cannot receive the data

Solution:

Use the file_get_contents('php://input',true) method in php

<?php
  $text=file_get_contents(&#39;php://input&#39;,true);
  echo $text;
?>


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn