Commit a1b7fb5673d4a476c18aab43dabda21864f01c9f
1 parent
7e26aeff47
Exists in
master
coba pakai header
Showing 1 changed file with 6 additions and 2 deletions Side-by-side Diff
partner-datacell.js
... | ... | @@ -92,13 +92,17 @@ function topupRequest(task, retry) { |
92 | 92 | host: "202.152.62.2", |
93 | 93 | path: "/RELOAD97.php", |
94 | 94 | port: 7713, |
95 | - method: "POST" | |
95 | + method: "POST", | |
96 | + headers: { | |
97 | + 'Content-Type': 'text/xml', | |
98 | + 'Content-Length': Buffer.byteLength(payload_xml) | |
99 | + } | |
96 | 100 | }; |
97 | 101 | |
98 | 102 | var buffer = ""; |
99 | 103 | var req = http.request( postRequest, function( res ) { |
100 | 104 | |
101 | - console.log( res.statusCode ); | |
105 | + console.log('Status code: ' + res.statusCode ); | |
102 | 106 | var buffer = ""; |
103 | 107 | res.on( "data", function( data ) { buffer = buffer + data; } ); |
104 | 108 | res.on( "end", function( data ) { console.log( buffer ); } ); |