我有一个小端点,用于通过 POST 接收数据。
如何将 JWT 与 file_get_content 集成?
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$json = file_get_contents('php://input');
$object = json_decode($json);
if (json_last_error() !== JSON_ERROR_NONE) {
die(header('HTTP/1.0 415 Unsupported Media Type'));
}
file_put_contents('callback.test.txt', print_r($object, true));
}
谢谢