我发布的所有数据都为空
下面是我的脚本
<?php
require "Constants.php";
if(mysqli_connect_errno()){
die('Unable to connect to database'.mysqli_connect_errno());
}
$ImageData = $_POST['ImageData'];
$profile_id = $_POST['profile_id'];
$ImagePath = 'eimg/'.$profile_id.'.jpg';
echo $ImagePath;
?>
在上面的代码中 $ImageData 和 $profile_id 都返回 null
这是我要发送的内容
最佳答案
在请求 header 中添加 Content-Type 作为 application/x-www-form-urlencoded 应该可以解决我猜的问题。
关于php - $_POST 返回 null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53967489/