restauth
v1.1.1
Published
An Authenticated Rest Client
Downloads
17
Readme
RestAuth
A Rest client supporting authentication with JSON Web Token and cookies. Useful for testing authenticated REST API.
Install
$ npm install --save restauth
Usage
import {Client} from 'restauth';
let config = {
username:"alice",
password:"password",
url:"http://localhost:3000/api/"
};
let client = new Client(config);
let resLogin = await client.login();
assert(resLogin);
let me = await client.get('v1/me');
assert(me);
Test
$ npm test
License
MIT © Frederic Heem