Ищу пример Node.js возврата XML из функции Azure. Код, который у меня ниже, возвращает строку xml, но для ответа Content-Type установлено значение text / plain; charset = utf-8 вместо text / xml; charset = utf-8
index.js
module.exports = function(context, req) {
var xml = '<?xml version="1.0" encoding="UTF-8"?><Response><Say>Azure functions!</Say></Response>';
context.res = {
contentType: 'text/xml',
body: xml
};
context.done();
};
Вот привязки.
function.json
{
"bindings": [
{
"authLevel": "function",
"type": "httpTrigger",
"direction": "in",
"name": "req"
},
{
"type": "http",
"direction": "out",
"name": "res"
}
],
"disabled": false
}