简体   繁体   中英

Using double quotes inside JSON keys or values

I would like to use double quotes " inside my JSON, but it doesn't work.

Here's my JSON

"I": {
        "1: Vehicle Con"trol:M": { 
            "D2": {
                "VM": "3300.00",
                "VSD": "324.04",
                "G":"1: Ve"hicle Control:M",
                "N":"-1"
            }
     }

JSON规范 http://json.org/

You can use \\" in your keys or values to escape "

This Json is valid - tested on JSONLint

{
    "I": {
        "1: VehicleCon\"trol: M": {
            "D2": {
                "VM": "3300.00",
                "VSD": "324.04",
                "G": "1: Ve\"hicleControl: M",
                "N": "-1"
            }
        }
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM