How to POST an xml element in python

前端 未结 3 1947
说谎
说谎 2021-02-01 08:32

Basically I have this xml element (xml.etree.ElementTree) and I want to POST it to a url. Currently I\'m doing something like

xml_string = xml.etree.ElementTree         


        
3条回答
  •  爱一瞬间的悲伤
    2021-02-01 09:15

    No, I think that's probably the best way to do it - it's short and simple, what more could you ask for? Obviously the XML has to be converted to a string at some point, and unless you're using an XML library with builtin support for POSTing to a URL (which xml.etree is not), you'll have to do it yourself.

提交回复
热议问题