https://github.com/binarymax/njord
Session-persistent HTTP client
https://github.com/binarymax/njord
Last synced: 5 months ago
JSON representation
Session-persistent HTTP client
- Host: GitHub
- URL: https://github.com/binarymax/njord
- Owner: binarymax
- License: mit
- Created: 2014-05-06T20:24:02.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-05-06T20:44:32.000Z (over 11 years ago)
- Last Synced: 2025-05-18T17:55:11.367Z (9 months ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Njörðr
Session-persistent HTTP client
Connect to a form-based login API, and execute requests
## Installation
```
npm install njord
```
## Example
```js
var njord = require('njord');
var session = njord.session('http://example.com/');
session.login('login/','username','password',function(err){
if(err) {
console.error('Could not login:', err);
} else {
session.get('myaccount/',function(err,accountdata){
if(err) {
console.error('Could not get account:', err);
} else {
console.log(accountdata);
}
});
}
});
```