curl发送json请求

跟计费部门对接,存管系统返回给他们的数据格式跟之前不一样,但是让他们重推又很麻烦,干脆自己模拟推送,自己解析了

CURL 发送json请求

1
curl -i -X POST -H "'Content-type':'application/json'" -d '{"details":{"info":"[{\"batchNo\":\"verifyTradeCipher__20190808105356_0000000000\",\"bizType\":\"AUTH_FIDUCIARY_PAYMENT\",\"authBizCreateTime\":1565232848000,\"authBizTransactionTime\":1565232848000,\"authBizStatus\":\"SUCCESS\"}]","requestNo":"verifyTradeCipher_20190808_0000000000","serviceName":"CgtDealCheckConfirmActionReq"}}' http://x.x.x.x/xxx.php

接收

1
2
$dataString = file_get_contents('php://input');
$dataObj = json_decode($dataString);
-------------本文结束感谢您的阅读-------------
坚持原创技术分享,您的支持将鼓励我继续创作!