M
M
mantovpinets2017-10-26 12:10:34
PHP
mantovpinets, 2017-10-26 12:10:34

How to send data from Angular 4 to php?

Good day to all.
I don't know if anyone has encountered this problem, but the problem is the following. I use AngularJS 4 on the front and php on the backend. The fact is that when sending data to the server via a post request, php responds that there is no data, and the $_POST array is empty. Has anyone fixed this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2017-10-26
@mantovpinets

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question