querystring. Parse ()
Turning a string into an object is the parameter string that is taken on the URL to the array object.
QueryString. Parse (str, [Sep], [EQ], [options])
Receive parameters:
STR to convert the string
Sep set delimiter, default to ' & '
EQ setting Assignment, default = ' = '
[Options] Maxkeys The maximum length of an acceptable string, default is 1000
Querystring.parse (' Foo=bar&baz=qux&baz=quux&corge ')// returns' Bar ', Baz: [' Qux ', ' Quux '], Corge: '}
Querystring.stringify ()
The object is formatted as a parameter string, and obj is the object to be formatted, the required parameter.
Querystring.stringify (Obj,[sep],[eq])
var a = {a:1,b:2}; Json.stringify (a); // Result: "{" A ": 1," B ": 2}"
Json.parse () and Json.stringify ()
Parse is used to parse a JSON object from a string, such as
var str = ' {' name ': ' Huangxiaojian ', ' age ': ' + '} '// Result:'"" Huangxiaojian " __proto__: Object
Stringify () is used to parse out a string from an object, such as
var a = {a:1,b:2}// Result:json.stringify (a)"{" A ": 1," B ": 2}"
String, object, and JSON handler functions in node. js