POST XML information using Python -
i creating program in python posts xml file website's rest api create vcs root (this website api documentation suggests). program creates xml file, based on user input, posts (using requests library), deletes file. there way can post information contained in xml file (mostly property values), without creating , deleting temporary xml file? can post information string or something? examples in python or curl help.
use data-attribute of requests
:
from io import bytesio import xml.etree.elementtree et data = et.element('some-xml') tree = et.elementtree(data) payload = bytesio() tree.write(payload) r = requests.post(url, data=payload.getvalue())
Comments
Post a Comment