shiori_transaction
v2.0.4
Published
SHIORI Protocol transaction
Downloads
21
Readme
shiori_transaction.js
SHIORI Protocol transaction
Install
npm:
npm install shiorijk shiori_converter shiori_transaction
This module depends on ShioriJK and shiori_converter.js.
Usage
node.js:
var shiori_transaction = require('shiori_transaction');
var ShioriTransaction = shiori_transaction.ShioriTransaction;
browser:
<script src="shiorijk.js"></script>
<script src="shiori_converter.js"></script>
<script src="shiori_transaction.js"></script>
var request3 = new ShioriJK.Message.Request({
request_line: {
method: 'GET',
version: '3.0',
},
headers: {
ID: 'OnBoot',
Charset: 'UTF-8',
Sender: 'Ikagaka',
},
});
var response2 = new ShioriJK.Message.Response({
status_line: {
code: 200,
version: '2.6',
},
headers: {
Sentence: '\\h\\s[0]\\e',
Charset: 'UTF-8',
Sender: 'ikaga',
},
});
var transaction = new ShioriTransaction();
transaction.request = request3;
console.log(request3.to('2.6').toString());
transaction.response = response2;
console.log(response2.to('3.0').toString());
API
License
This is released under MIT License.