Node Director
|
Convert a web browser cookie list string to a JSONObject and back. More...
Static Public Member Functions | |
static JSONObject | toJSONObject (String string) throws ParseException |
Convert a cookie list into a JSONObject. | |
static String | toString (JSONObject o) |
Convert a JSONObject into a cookie list. |
Convert a web browser cookie list string to a JSONObject and back.
|
static |
Convert a cookie list into a JSONObject.
A cookie list is a sequence of name/value pairs. The names are separated from the values by '='. The pairs are separated by ';'. The names and the values will be unescaped, possibly converting '+' and '' sequences.
To add a cookie to a cooklist, cookielistJSONObject.put(cookieJSONObject.getString("name"), cookieJSONObject.getString("value"));
string | A cookie list string |
ParseException |
References org.json.JSONTokener.more(), org.json.JSONTokener.next(), org.json.JSONTokener.nextTo(), org.json.JSONObject.put(), and org.json.JSONTokener.unescape().
Referenced by org.json.Test.main().
|
static |
Convert a JSONObject into a cookie list.
A cookie list is a sequence of name/value pairs. The names are separated from the values by '='. The pairs are separated by ';'. The characters '', '+', '=', and ';' in the names and values are replaced by "%hh".
o | A JSONObject |
References org.json.Cookie.escape(), org.json.JSONObject.getString(), org.json.JSONObject.isNull(), and org.json.JSONObject.keys().
Referenced by org.json.Test.main().