Я пытаюсь отправить xml-запрос на веб-службу через Node.js, используя http.request
.
Вот мой код. Моя проблема в том, что вместо data=1
я хочу отправить xml в службу.
http.request({
host: 'service.x.yyy.x',
port: 80,
path: "/a.asmx?data=1",
method: 'POST'
}, function(resp) {
console.log(resp.statusCode);
if(resp.statusCode) {
resp.on('data', function (chunk) {
console.log(chunk);
str += chunk;
});
resp.on('end', function (chunk) {
console.log(str);
});
}
}).end();
Хо сделать это?