简体   繁体   中英

JSON input string with double quotes

I have the following JSON request which i need to parse and pull some data from the database, for the sake of the issue please assume that the double quotes within strings are allowed to mark inches how can I ignore the double quotes for string "test"er" and simply pass "tester" ?

{
  "searchtype":"search",
  "searchspec":{
    "source":"user",
    "searchstring":"test"er"
  }
}

Simply add a \\ before the double quote. Try this:

{"searchtype":"search","searchspec":{"source":"user","searchstring":"test\"er"}

You can try like this.

{
  "searchtype": "search",
  "searchspec": {
    "source": "user",
    "searchstring": "test\"er\""
  }
}

After making changes, you can verify in this link http://jsonviewer.stack.hu/

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