0.0.1 • Published 9 years ago

request-digest-md5 v0.0.1

Weekly downloads
6
License
ISC
Repository
github
Last release
9 years ago

Request digest client in Node.js Build Status

NPM

Perform a client request (http) with a digest authentication

Disclaimer

Only tested against one server and spec is not followed fully. It works for me and for what I am doing. Later I'll update with unit tests and more options available. Pay attention, it only works with MD5 algorithm currently.

Usage

var digestRequest = require('request-digest')('username', 'password');
digestRequest.request({
  host: 'http://test.com',
  path: '/api/v1/test.json',
  port: 80,
  method: 'GET',
  headers: {
    'Custom-Header': 'OneValue',
    'Other-Custom-Header': 'OtherValue'
  }
}, function (error, response, body) {
  if (error) {
    throw error;
  }

  console.log(body);
});

The digest client will make one reques to the server, authentication response is calculated and then the request is made again. Hopefully you will then be authorized.

Contributions

Feel free to contribute and extend this package and if you have bugs or if you want more specs make an issue. Have fun !


Made by Coenen Benjamin with love