Skip to content
simplified HTTP client with automatic Chinese encoding conversion
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

request-gb

Build Status Coverage Status npm version Dependency Status

https://www.npmjs.org/package/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

You can’t perform that action at this time.