sendFile can support file path, stream, array of file path and array of
streams. Each file is stored with the key 'file + index' (file0, file1,
file2...) in the request in case of array. For a single value, it is stored in
the field with key 'file'.
If you use a stream, it must have a "path" attribute containing its path or filename.

Extra: basic authentication

client.setBasicAuth('john','secret');

client.get('private/posts/',function(err,res,body){

returnconsole.log(body.rows[0].title);

});

Extra: headers manipulation

client.headers['Cookie']='Your cookie';

Extra: promises

client.get('posts/')

.then(function(result){

console.log(result.res.statusCode);

console.log(result.body);

}).catch(err){

console.log(err);

}

});

Who uses it

request-json and request-json-light are downloaded more than 50 000 times each
month. Here are the companies which use it for their API clients: