i am trying to submit a xml request to a web service via Node.js using http.request
.
Here is my code. My issue is that instead of data=1
i want to post xml to the service.
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();
Ho to do this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…