如何检查 PHP 中 POST 请求的内容类型是 application/json 还是 application/x-www-form-urlencoded?
我尝试过使用$_SERVER["CONTENT_TYPE"]andecho get_headers('url', 1)["Content-Type"]但这些都不适合我。
$_SERVER["CONTENT_TYPE"]
echo get_headers('url', 1)["Content-Type"]
php content-type header
content-type ×1
header ×1
php ×1