-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestBCRequest.js
More file actions
23 lines (19 loc) · 779 Bytes
/
TestBCRequest.js
File metadata and controls
23 lines (19 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
var request = require('request');
var bigchainServer = 'http://10.100.98.217:5000/'
var bigchainInput = {"msg": "hi"}
bigchainInput = JSON.stringify(bigchainInput)
var bigchainEndpoint = 'addData/' + '12321' + '/0'
// var bigchainEndpoint = 'addData'
var theobj = {"method": "POST", "stringJSONData": bigchainInput, "endpoint": bigchainEndpoint}
bigchainDataStringified = JSON.stringify(bigchainInput);
request({
method: 'POST',
url: bigchainServer + 'addData/1Sha2321/1',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({"msg":"hi"})
}, function (error, response, body) {
var theResponse = body;
console.log(theResponse + " was the response")
});