0

I have zero knowledge on XML since I really use JSON but I have a project that includes XML transactions so I have no choice Basically, a request will sent to my API and then I will have to respond via XML like this

<?xml version="1.0" encoding="UTF-8"?>
<authenticate version="2.0">
<vendor_member_id>Unique_ID</vendor_member_id>
<status_code>0</status_code>
<message>OK</message>
</authenticate>

Need help please, I don't know how to achieve this..

The tricky part here is the

<authenticate version="2.0"> 

how will I show that?

Dean Christian Armada
  • 6,724
  • 9
  • 67
  • 116

1 Answers1

1

That's definitely you can acheive this using Django RestFramework.

Found this django-rest-framework-xml

i.e)

REST_FRAMEWORK = {
    'DEFAULT_PARSER_CLASSES': (
        'rest_framework_xml.parsers.XMLParser',
    ),
    'DEFAULT_RENDERER_CLASSES': (
        'rest_framework_xml.renderers.XMLRenderer',
    ),
}
Raja Simon
  • 10,126
  • 5
  • 43
  • 74