You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you set the Content-Type header to 'text/xml' and the body to some valid XML, the actual response of the function is <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">[escaped xml here]</string>
Repro steps
module.exports = function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
context.res.set('Content-Type', 'text/xml');
context.res.body = '<?xml version="1.0" encoding="UTF-8"?><Response><Message>Hi there!' +
'</Message></Response>';
context.done();
};
I would expect the Content-Type header to be text/xml and the body of the response to contain my XML and nothing else.
Actual behavior
The actual response of the function is <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">[escaped xml here]</string>
Known workarounds
If I set the Content-Type to 'text/html', it leaves my XML body unmolested. The content type isn't right, but Twilio will accept text/html. Other use cases requiring XML output may not have this workaround.
The text was updated successfully, but these errors were encountered:
When you set the Content-Type header to 'text/xml' and the body to some valid XML, the actual response of the function is
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">[escaped xml here]</string>
Repro steps
function.json
:Expected behavior
I would expect the Content-Type header to be text/xml and the body of the response to contain my XML and nothing else.
Actual behavior
The actual response of the function is
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">[escaped xml here]</string>
Known workarounds
If I set the Content-Type to 'text/html', it leaves my XML body unmolested. The content type isn't right, but Twilio will accept text/html. Other use cases requiring XML output may not have this workaround.
The text was updated successfully, but these errors were encountered: