super-http-client

0.1.0 • Public • Published

Super HTTP Client

Overview

Extends the node http library with digest authorisation (thanks to the http-digest-client package; this code is taken and modified and can be found in digest.js), and wraps it all up in a nice Promises based API (rather than the callback API typical of node).

Usage

Install:

npm install extra-lo

Basic usage:

 
var request = require('super-http-client');
 
  var promise = request({
    auth: {
      type: 'digest',
      username: 'username',
      password: 'password'
    },
    host: 'localhost',
    path: '/myRestAPI',
    port: 8000,
    method: 'PUT',
    headers: {'Content-type': contentType || 'application/json'},
    content: '{"someKey": "someValue"}'
  });
  
  promise.then(function(result){console.log(result);});

Readme

Keywords

none

Package Sidebar

Install

npm i super-http-client

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • christyharagan