Last active
December 15, 2019 14:32
-
-
Save Sheikh2Imran/be2f029fc8d255c5d4f2fcdcb40f1c28 to your computer and use it in GitHub Desktop.
Convert json object to xml object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data = { | |
| "id": "124324", | |
| "name": "testname", | |
| "email": "testname@gmail.com", | |
| "password": "test1234" | |
| } | |
| def get_json_to_xml_data(data): | |
| return f''' | |
| <?xml version="1.0"?> | |
| <COMMAND> | |
| <ID>{requested_data['id']}</ID> | |
| <NAME>{requested_data['name']}</NAME> | |
| <EMAIL>{requested_data['email']}</EMAIL> | |
| <PASSWORD>{requested_data['password']}</PASSWORD> | |
| </COMMAND> | |
| ''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment