kennethreitz/requests — pull request #1743 by kevinburke (2013-11-18 08:54:49+00:00)
Title: Separate connect timeouts

Support separate connect timeouts in Requests by allowing you to write something like

```python
import requests.structures.Timeout
t = Timeout(connect=3, read=7)
requests.get('https://api.twilio.com', timeout=t)
```

Adds tests, docs and some new exceptions for this functionality.

Please note, this kills the current `stream` based branching of timeouts. The `timeout` value applies only to the amount of time between bytes sent by the server. So, if a read timeout is set to 20 seconds and the server streams one byte every 15 seconds, the read timeout will never get hit. This means long streaming downloads are ok and won't hit the read timeout even if it's specified.

It is perfectly valid to set a read timeout on a streaming request - if the request doesn't start streaming in 15 seconds, then raise an error. With the current master, this is impossible.