amnong / easywebdav

A WebDAV Client in Python
http://pypi.python.org/pypi/easywebdav/
ISC License
207 stars 113 forks source link

Allow passing arbitrary args to requests #25

Open damiencorpataux opened 10 years ago

damiencorpataux commented 10 years ago

Simple implementation: this is done by adding **kwargs to _send and all its user functions (eg. download, upload, etc.)

Implementation sample:

    def _send(self, method, path, expected_code, **kwargs):
        url = self._get_url(path)
        response = self.session.request(method, url, allow_redirects=False, **kwargs)
        ...
        return response

    def mkdir(self, path, safe=False, **kwargs):
        expected_codes = 201 if not safe else (201, 301, 405)
        self._send('MKCOL', path, expected_codes, **kwargs)

This allows passing args to the underlying requests session:

import webdav
c = webdav.connect(...)
c.exists('/', timeout=2)
joas77 commented 5 years ago

Is this project dead? I think this would be a great improvement