Home >Backend Development >PHP Tutorial >php Request request json data packet is escaped
POST request interface, send data packet as shown below
Header is as shown below
Then when I interfaced $request = file_get_contents("php://input");
and var_dump($request)
, the printed content was as shown in the Body in Figure 1. At first, I thought it was due to environmental reasons. , php://input needs to set always_populate_raw_post_data = -1
in php.ini.
In the end, the printed content is still the same. What I expected was to print out
I hope someone can give me some advice to solve this problem.
POST request interface, send data packet as shown below
Header is as shown below
Then when I interfaced $request = file_get_contents("php://input");
and var_dump($request)
, the printed content was as shown in the Body in Figure 1. At first, I thought it was due to environmental reasons. , php://input needs to set always_populate_raw_post_data = -1
in php.ini.
In the end, the printed content is still the same. What I expected was to print out
I hope someone can give me some advice to solve this problem.
Young man, you have enabled the xdebug module, so the output will have a beautifying effect. What you see is the html tag plus the escape code.
Uninstall this module
or
Turn off the html_errors
option in php.ini
Is the var_dump
method rewritten? I see that your return body has some extra tags, and the data is correct.
You turned on xdebug