From 04d0f9ff4a1fe7c464673cf23db1eb9c38298e07 Mon Sep 17 00:00:00 2001 From: Eric Henson Date: Fri, 20 Sep 2019 11:41:17 -0500 Subject: [PATCH] Using a POST There seems to be a Node limitation of the GET path size. --- lib/irest.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/irest.js b/lib/irest.js index 748995b8..c96c0da8 100644 --- a/lib/irest.js +++ b/lib/irest.js @@ -24,9 +24,14 @@ const iRestHttp = (callback,xhost,xport,xpath,xdatabase,xuser,xpassword,xipc,xct + "&xmlout=" + xml_output_max_size); // myibmi/cgi-bin/xmlcgi.pgm?xml let options = { + method: 'POST', host: xhost, - port: xport, - path: xpath + '?' + xml_enc + port: xport, + path: xpath, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Content-Length': Buffer.byteLength(xml_enc) + } }; const httpCallback = (response) => { let str = ''; @@ -40,7 +45,9 @@ const iRestHttp = (callback,xhost,xport,xpath,xdatabase,xuser,xpassword,xipc,xct }); } // make the call - http.request(options, httpCallback).end(); + let req = http.request(options, httpCallback); + req.write(xml_enc); + req.end(); } -exports.iRestHttp = iRestHttp; \ No newline at end of file +exports.iRestHttp = iRestHttp;