将 JWT 与 file_get_contents 集成

问题描述 投票:0回答:0

我有一个小端点,用于通过 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));
}

谢谢

php api endpoint
© www.soinside.com 2019 - 2024. All rights reserved.