Module basic module

Module querystring

http query processing module

Reference method:

1
var querystring = require('querystring');

Static function

escape

url Part string security encoding

1
static String querystring.escape(String str);

Call parameters:

  • str: String, to be encoded url

Return result:

  • String, Return the encoded string

unescape

url Secure string decoding

1
static String querystring.unescape(String str);

Call parameters:

  • str: String, to be decoded url

Return result:

  • String, Return 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 yet 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 yet supported

Return result:

  • String, Returns the serialized string