-2

I am trying to define the Json string to convert that into a JSONObject. When i define the string as "String jsonObj = "{"abc":"efg"}";" in mule java class, it gives me "Syntax error on token, delete this token" error. Thanks!

Charu V
  • 3
  • 1

2 Answers2

0

You should escape double quotes with backslash: String jsonObj = "\"{\"abc\":\"efg\"}\"";

Ivan Pronin
  • 1,768
  • 16
  • 14
0

You can also specify json in set payload and then use json-to-object

Suyog Sathe
  • 114
  • 1
  • 1
  • 5