amnong/easywebdav — pull request #25 by damiencorpataux (2014-07-24 19:56:51+00:00)
Title: Allow passing arbitrary args to requests

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

Implementation sample:
```python
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:
```python
import webdav
c = webdav.connect(...)
c.exists('/', timeout=2)
```