I have the following JSON string that i am sending to a NodeJS server:
String string = \"{\\\"id\\\":\\\"\" + userID + \"\\\",\\\"type\\\":\\\"\" + methoden
org.json.simple.JSONObject.escape() escapes quotes,, /, \r, \n, \b, \f, \t and other control characters.
org.json.simple.JSONObject.escape()
import org.json.simple.JSONValue; JSONValue.escape("test string");
Add pom.xml when using maven
com.googlecode.json-simple json-simple test