简体   繁体   中英

How can I get XML data in Python/Django passed in POST request?

There is XML data passed in POST request as a simple string and not inside some name=value pair, with HTTP header (optionally) set to 'Content-Type: text/xml' .

How can I get this data in Python (by its own ways or by tools of Django)?

I'm not quite sure what you're asking. Do you just want to know how to access the POST data? You can get that via request.body , which will contain your XML as a string. You can then use your favourite Python XML parser on it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM