I know that in java when you wish to use quotation marks in a string you should do something like this: private String quotationMarks = "\"";
It’s all great when working in eclipse – but here is the thing: I have a method that returns a string – with quotation marks in it; and when I invoke this method by REST (curl) I see the back-slash as well. Say my method returned the following string: what a good "day" – then when I invoke this method by curl – I get what a great \"day\" and that’s not good for me.
Why is that and how can I avoid this back-slash to be returned?
I know that in java when you wish to use quotation marks in a
Share
As the key-value in JSON are double-quoted in format {“text”:”what a good day”}. So, if there is already a quoted string in value, the json builder library you are using will automatically add escape charater before double quotes.
Eg. in your case
You can check validity of your json at JSONLint