I have an azure function setup with this source:
module.exports = function(context, req) {
context.done(null, {favoriteNumber : 3});
};
When I use a tool like a postman to visit him, I get a good JSON output, just like I want:
{
"favoriteNumber": 3
}
The problem is that I visit it in the browser (chrome, firefox, etc.). I see:
<ArrayOfKeyValueOfstringanyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/2003/10/Serialization/Arrays"><KeyValueOfstringanyType><Key>favoriteNumber</Key><Value xmlns:d3p1="http://www.w3.org/2001/XMLSchema" i:type="d3p1:int">3</Value></KeyValueOfstringanyType></ArrayOfKeyValueOfstringanyType>
How can I get azure to always give me json output, regardless of request headers?
source
share