Optional XML API response output support #2

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
1 participant

richtr commented Nov 25, 2011

This patch adds support for XML output to be returned at the discretion of the ComponentAPI.

To set the response type to XML you can simply add the following to any method in a class implementing the MashapeRestAPI (e.g. /api.php):

parent::setOutputToXml();

If you want to change the name of the root XML node (from the default ) then simply pass in the new name for the root node as the only parameter to the function:

parent::setOutputToXml("timezone");

That's it!


XML support may also need to be patched to the client libraries.

richtr closed this Nov 25, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment