upyun-http-signature
v0.1.5
Published
a simple lib for generate a signature for upyun http REST api
Downloads
8
Readme
upyun-http-signature
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 pathcontent_length
: content-length of the request, if no request body, it should be0
password
: operator's passwordoperator
: 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