Add Formatting Options to TwiML methods and classes + refactor #95
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added overloads for TwiML methods and TwiML Result classes to accept the formatting options of the XML.
This way, a user can choose to remove the formatting and respond with smaller XML payloads. (implements #89)
I did a larger refactor of the
TwiMLResult
class for MVC. This refactoring does the following:TwiML
directly to response output instead of creating anXDocument
of it first.string
directly to response output instead of creating anXDocument
of it first. TheXDocument
would've automatically used the correct encoding that is used by the response output. In this case, I'm assuming the user knows what the correct encoding is and has created the XML string correctly to match the output encoding.Encoding
anymore as the code that needed it no longer exists.Personally, I think we can lose the
XDocument
andstring
constructors forTwiMLResult
to simplify the class.Ascii and Unicode still work as expected as I still receive those characters via SMS. I added tests to verify that the TwiML is written to the output correctly, respecting the output encoding.
Contributing to Twilio