0.1.5 • Published 10 years ago

upyun-http-signature v0.1.5

Weekly downloads
6
License
MIT
Repository
github
Last release
10 years ago

upyun-http-signature

NPM version Build status Test coverage

a simple lib for generate a signature for upyun http REST api

Installation

$ npm install upyun-http-signature

Usage

sign(http_method, path, date, content_length, password, operater);

Arguments

  • http_method: HTTP method(eg, 'GET', 'PUT', etc)
  • path: request path
  • content_length: content-length of the request, if no request body, it should be 0
  • password: operator's password
  • operator: upyun bucket's operator

In Node.js

var sign = require('upyun-http-signature');

console.log(sign('GET', '/test', date, 10, 'password', 'operator'));

In browser (with browserify)

<script src="../dist/upyun-sign-browserify.min.js"></script>
<script>
var sign = require('upyun-http-signature');

var date = 'Wed Oct 08 2014 16:20:11 GMT+0800 (CST)';
console.log(sign('GET', '/test', date, 10, 'password', 'operator'));
</script>

you can see the demo for this.

License

MIT © Leigh Zhu

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago