Skip to content

DEFAULT_TWIML_CONTENT_TYPE

const DEFAULT_TWIML_CONTENT_TYPE: "text/xml" = 'text/xml';

Defined in: lib/twiml/twiml.interceptor.ts:61

The Content-Type header TwimlInterceptor sets when neither a TwimlResponseType decorator nor a constructor option overrides it.

Twilio’s own documentation uses text/xml; application/xml is also accepted, which is why the value is overridable.

// Restore the default explicitly on one route.
@Post('/voice')
@TwimlResponseType(DEFAULT_TWIML_CONTENT_TYPE)
voice() {
return new VoiceResponse();
}