且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

HttpURLConnection向Apache / PHP发送JSON POST请求

更新时间:2022-11-27 11:12:36

echo (file_get_contents('php://input'));

将显示json文本。使用它像:

Will show you the json text. Work with it like:

$jsonString = file_get_contents('php://input');
$jsonObj = json_decode($jsonString, true);