hack-rpi / Status-Board

Hackathon commit messages, announcements, mentor requests, and more, all in one place!
https://status.hackrpi.com
MIT License
14 stars 5 forks source link

Not Creating Valid TwiML #38

Open mpoegel opened 9 years ago

mpoegel commented 9 years ago

I absolutely cannot figure out why Twilio is rejecting the TwiML I return after receiving a POST request:

 return {
  statusCode: code,
  headers: {
    'Content-Type': 'text/xml'
  },
  body: '<?xml version="1.0" encoding="UTF-8"?>' +
    '<Response>' +
      '<Sms>' + message + '</Sms>' +
    '</Response>'
};

The current workaround is to return as 'Content-Type': 'text/plain' and Twilio will automatically reply with a text with the content of the body. It works fine, but I would really like to figure out why the TwiML isn't working.