I'm hoping someone can help, I've got AWS Lambda returning some XML in context.succeed
or context.fail
everything is excellent apart from one small part. echo out the XML, but because the header still has Content-Type: application/json
and the Twilio server I'm talking too is looking at this and rejecting it even though the body is actually valid XML.
Is there a way to override the header?
Many thanks.
If you look in the API Gateway console and select the method in question, you should see a section titled Method Response on the right side. If you select that you should see the various response codes and you can add one or select an existing one and change the Content-Type
associated with that response.