简体   繁体   中英

Is there any escape symbol for { in JSON?

I am using rest api and using content type as JSON . I am giving some value to POST method with { in it. So , it giving out as bad request. So, it is possible to escape { and print the following

"MISSING VALUES: Please put the description of the with mandatory field {code} \\n StudentId {code}"

There is no special escape character for { or } since the only valid place for them to be is in the JSON structure to denote the begin or end of an object, or in strings where they don't need escaping. They are not allowed as field names so no need to escape them.

I guess there is something else wrong with your request.

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