Skip to content

Commit e8063ea

Browse files
committed
fix fabric rest wrapper
1 parent f720e45 commit e8063ea

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

fabric-rest.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,26 @@ var filename = argv["_"][0]
1414

1515
var args = {
1616
};
17-
function run_data(method, args) {
17+
function run_data(method, data) {
1818
client.registerMethod("method", local + method.method, method.action);
19-
client.methods.method(args, function(data, response) {
20-
console.log(data);
21-
});
19+
client.methods.method({data: data,
20+
headers:
21+
{"Content-Type": "application/json"}},
22+
function(data, response) {
23+
console.log(data);
24+
});
2225
}
2326

2427
jsonfile.readFile(argv["_"][0], function(err, method) {
2528
if (err != null) {
2629
console.log(err);
2730
} else {
2831
if (argv["_"][1] != undefined) {
29-
jsonfile.readFile(argv['_'][1], function(err, args) {
32+
jsonfile.readFile(argv['_'][1], function(err, data) {
3033
if (err != null) {
3134
console.log(err);
3235
} else {
33-
console.log(args);
34-
run_data(method, args);
36+
run_data(method, data);
3537
}
3638
});
3739
} else {

0 commit comments

Comments
 (0)