org.json.CookieList Class Reference

List of all members.

Static Public Member Functions

static JSONObject toJSONObject (String string) throws JSONException
static String toString (JSONObject o) throws JSONException

Detailed Description

Convert a web browser cookie list string to a JSONObject and back.

Author:
JSON.org
Version:
2008-09-18

Member Function Documentation

static JSONObject org.json.CookieList.toJSONObject ( String  string  )  throws JSONException [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"));

Parameters:
string A cookie list string
Returns:
A JSONObject
Exceptions:
JSONException 
static String org.json.CookieList.toString ( JSONObject  o  )  throws JSONException [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".

Parameters:
o A JSONObject
Returns:
A cookie list string
Exceptions:
JSONException