Skip to content

Conversation

@damiencorpataux
Copy link

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)

This is done by adding **kwargs to _send
and all its user functions (eg. download, upload, etc.)
@joas77
Copy link

joas77 commented Mar 19, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants