Package Exports
- request-gb
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (request-gb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
request-gb
This module extends request/request's Request class with a automatic Chinese encoding conversion.
It is backed by the request module, so see its README for more details.
Installation
$ npm install request-gb
Example
// get a page
var request = require('request-gb');
request.get('http://www.xxx.com', {gzip:true}, function(err, res){
console.log(res);
});
// download a file
request.download(
'http://gravatar.com/avatar/84cbf739853b2e023328e2c0428d663c',
'http://en.gravatar.com/',
{gzip:true},
'/users/xxx/avatar.jpg',
function(err, res){
console.log(res.length);
});
// read file data into a Buffer
request.download2Buffer(
'http://gravatar.com/avatar/84cbf739853b2e023328e2c0428d663c',
'http://en.gravatar.com/',
{gzip:true},
function(err, buf){
console.log(buf.length);
});
License
MIT