ElementTree.write() to an URL is using PUT, not POST
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Confirmed
|
Low
|
Unassigned |
Bug Description
Python : sys.version_
lxml.etree : (4, 2, 1, 0)
libxml used : (2, 9, 4)
libxml compiled : (2, 9, 4)
libxslt used : (1, 1, 29)
libxslt compiled : (1, 1, 29)
When writing a XML to an URL, lxml ends up using HTTP PUT method instead of POST. Documentation at https:/
> ... or the ElementTree.write() method that writes to a file, a file-like object, or a URL (via FTP PUT or HTTP POST).
Either docs or code should be fixed to match each other. If possible, the HTTP method should be an argument to ElementTree.
I've looked at both lxml and libxml2 source codes, all it takes for lxml to use POST is a call to libxml2's `xmlRegisterHTT
PUT seems right. Could you provide a PR to fix the docs?
Enabling POST requests then is a new feature. Feel free to work on that, too, if you want.