我正在嘗試發送 json 格式,但它說 json 格式無效。
{
"requestId": {
'value': 'Hello'
},
"identifier": {
'value': {
'value': '3440869'
},
'refType': 1
},
"userInfo": {
'customerStatus': 'CLOSED'
}
}
它給了我
Parse error on line 2:
..."requestId": {
'value': 'Hello'
----------------------^
Expecting 'STRING', '}', got 'undefined'
uj5u.com熱心網友回復:
您需要用雙引號替換所有單引號。那么它是有效的json。
{
"requestId": {
"value": "Hello"
},
"identifier": {
"value": {
"value": "3440869"
},
"refType": 1
},
"userInfo": {
"customerStatus": "CLOSED"
}
}
uj5u.com熱心網友回復:
您應該用雙引號替換所有單引號,
您可以在任何 json 編輯器中驗證您的 JSON 格式,例如:
https://jsoneditoronline.org/
使用 jsoneditoronline.org 檢查格式
這是正確的格式:
{
"requestId": {
"value": "Hello"
},
"identifier": {
"value": {
"value": "3440869"
},
"refType": 1
},
"userInfo": {
"customerStatus": "CLOSED"
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/343645.html
標籤:json
