T
T
tatarrr952019-08-19 20:31:52
PHP
tatarrr95, 2019-08-19 20:31:52

A post request arrives, how to read the body?

A post request should arrive on the server, but I don’t know what it looks like, what body it has. Perhaps it is immediately in jsone, but perhaps not. How can I understand all this information and save it to textbook? PHP

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2019-08-19
@tatarrr95

var_dump(php://input);
And it’s better to check $_POST too, because:

php://input is not available with content type enctype="multipart/form-data".

M
Mitya ToDaSyo, 2019-08-19
@dimastik1986

var_dump($_REQUEST);
file_put_contents();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question