File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -14,24 +14,26 @@ var filename = argv["_"][0]
14
14
15
15
var args = {
16
16
} ;
17
- function run_data ( method , args ) {
17
+ function run_data ( method , data ) {
18
18
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
+ } ) ;
22
25
}
23
26
24
27
jsonfile . readFile ( argv [ "_" ] [ 0 ] , function ( err , method ) {
25
28
if ( err != null ) {
26
29
console . log ( err ) ;
27
30
} else {
28
31
if ( argv [ "_" ] [ 1 ] != undefined ) {
29
- jsonfile . readFile ( argv [ '_' ] [ 1 ] , function ( err , args ) {
32
+ jsonfile . readFile ( argv [ '_' ] [ 1 ] , function ( err , data ) {
30
33
if ( err != null ) {
31
34
console . log ( err ) ;
32
35
} else {
33
- console . log ( args ) ;
34
- run_data ( method , args ) ;
36
+ run_data ( method , data ) ;
35
37
}
36
38
} ) ;
37
39
} else {
You can’t perform that action at this time.
0 commit comments