From a1b7fb5673d4a476c18aab43dabda21864f01c9f Mon Sep 17 00:00:00 2001 From: Adhidarma Hadiwinoto <gua@adhisimon.org> Date: Wed, 22 Jul 2015 15:54:15 +0700 Subject: [PATCH] coba pakai header --- partner-datacell.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/partner-datacell.js b/partner-datacell.js index 0b8f6ff..5b60828 100644 --- a/partner-datacell.js +++ b/partner-datacell.js @@ -92,13 +92,17 @@ function topupRequest(task, retry) { host: "202.152.62.2", path: "/RELOAD97.php", port: 7713, - method: "POST" + method: "POST", + headers: { + 'Content-Type': 'text/xml', + 'Content-Length': Buffer.byteLength(payload_xml) + } }; var buffer = ""; var req = http.request( postRequest, function( res ) { - console.log( res.statusCode ); + console.log('Status code: ' + res.statusCode ); var buffer = ""; res.on( "data", function( data ) { buffer = buffer + data; } ); res.on( "end", function( data ) { console.log( buffer ); } ); -- 1.9.0