1

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)?

0

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Yes, accessing POST data is what I'm trying to do.
It works as expected, thank you :) Does it work in Django only?
I don't know where else you would use it. The HttpRequest class is defined in Django, yes.
There is request.body also in Flask. Perhaps, some kind of a standard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.