Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,26 @@ with httpx.timeout(3.0) as t:

---

## Rate limiting

Network rate limiting can be applied using context blocks.

```python
with httpx.rate_limit("25MB/s"):
...
```

Differing rate limits for upload and download speeds may be applied.

```python
with httpx.rate_limit(upload="10MB/s", download="25MB/s"):
...
```

Supported data rates must be specified in units of bytes per second... `B/s`, `KB/s`, `MB/s`, `GB/s`, `TB/s`.

---

## Sending HTTP requests

Let's take a look at how we can work directly with a network backend to send an HTTP request, and recieve an HTTP response.
Expand Down