寻找从Azure函数返回
XML的Node.js示例.我下面的代码返回xml的字符串,但响应Content-Type设置为text / plain; charset = utf-8而不是text / xml;字符集= 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 }