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

巴扎黑
Release: 2016-11-09 13:22:20
Original
1018 people have browsed it

$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;
?>
Copy after login


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template