I am trying to send an xml string to a third party server. The string has to be ISO-8859-8
encoded. Here's what I try using request and iconv-lite:
var request_xml = 'my xml string...';
var header = "<?xml version='1.0' encoding='ISO-8859-8'?>";
request_xml = header.concat(request_xml);
var buf = iconv.encode(request_xml, 'iso-8859-8');
var req = {
url: env.url,
method: 'post',
form: {
user: env.user,
password: env.password,
int_in: buf,
}
};
request(req, function(err, res, body) {
...
}
This just doesn't work, not sure If it's possible to pass a Buffer as a form data on request. Does anybody know a way ?
Thanks