If you want to include a literal double quote in the JSON string, you must avoid it by specifying a backslash \ . So your JSON string should look like this:
{"key" : " \"Some text WITH quotes\" "}
See json.org for the official JSON syntax.
The forward slash / not a special character and does not require escaping. The backslash \ must be escaped with itself: \\ .
Beware that Java \ also an escape character in the source code, as well as " also need to be escaped, which means that if you use them as literals in your source code, you must escape them again.
StringBuilder sb = new StringBuilder(); sb.append("{\"key\" : \" \\\"Some text WITH quotes\\\" \"");
source share