Module basic module

Module querystring

http query processing module

Reference method:

1
var querystring = require('querystring');

Static function

escape

url component string security encoding

1
static String querystring.escape(String str);

Call parameters:

  • str : String, url to be encoded

Return result:

  • String , returns the encoded string

unescape

url safe string decoding

1
static String querystring.unescape(String str);

Call parameters:

  • str : String, url to be decoded

Return result:

  • String , returns the decoded string

parse

Parse the query string

1 2 3 4
static HttpCollection querystring.parse(String str, String sep = "&", String eq = "=", Object opt = {});

Call parameters:

  • str : String, the string to be parsed
  • sep : String, the split string used in parsing, the default is &
  • eq : String, the assignment string used in parsing, the default is =
  • opt : Object, parsing parameters, not currently supported

Return result:


stringify

Serialize an object as a query string

1 2 3 4
static String querystring.stringify(Object obj, String sep = "&", String eq = "=", Object opt = {});

Call parameters:

  • obj : Object, the object to be serialized
  • sep : String, the split string used during serialization, the default is &
  • eq : String, the assignment string used during serialization, the default is =
  • opt : Object, parsing parameters, not currently supported

Return result:

  • String , returns the serialized string