获取邮递员在 php 上发送的原始数据
Get raw data sent by postman on php
我正在通过邮递员将一些原始 json 数据发送到 php 脚本
Headers
Sent data
我尝试在脚本上显示请求数据
<?php
var_dump($_POST);
但我收到了这个回复
数组(0){ }
$_POST
数组用于 form data requests.
您需要从输入中读取 json:
$jsonData = json_decode(file_get_contents("php://input"), true);
我正在通过邮递员将一些原始 json 数据发送到 php 脚本
Headers
Sent data
我尝试在脚本上显示请求数据
<?php
var_dump($_POST);
但我收到了这个回复
数组(0){ }
$_POST
数组用于 form data requests.
您需要从输入中读取 json:
$jsonData = json_decode(file_get_contents("php://input"), true);