z*****e 发帖数: 74 | 1 Hi, I am trying to do following, not sure if it is possible:
1: On server one, posting data using:
curl -i -X POST -d 'json={
"disk": {
"root": "56%",
"tmp" : "4%",
"opt" : "7%",
"var" : "9%"
}
}'
2: On http server 2, a PHP script is used to capture the JSON data:
var_dump( $_POST['json'] );
$jsonObj = json_decode( $_POST['json'], true );
var_dump( $jsonObj );
?>
But dump $jsonObj is NULL.
I am new to JSON ... any idea what I am missing?
Thanks | a9 发帖数: 21638 | 2 是不是双引号得转义啊?
【在 z*****e 的大作中提到】 : Hi, I am trying to do following, not sure if it is possible: : 1: On server one, posting data using: : curl -i -X POST -d 'json={ : "disk": { : "root": "56%", : "tmp" : "4%", : "opt" : "7%", : "var" : "9%" : } : }'
| z*****e 发帖数: 74 | 3 not sure ... first var_dump works fine. Bit decode was not working |
|