HTTP utilities.
Methods
-
<static> get(ii, cb)
-
Get HTTP/HTTPS data.
Remark: use 'file://' for local test automation.Parameters:
Name Type Description iiObject Input Information Properties
Name Type Description urlstring URL ('http://', 'https://' or 'file://') encodingstring Text encoding (default 'utf8') cbfunction Callback Properties
Name Type Description erError datastring Example
var http = mbot.load('util/http'); http.get({ url: 'https://github.com/search?q=chat' }, function(er, data) { if (er) console.log('error: ' + er); else console.log('data: ' + data); });