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
8 changes: 5 additions & 3 deletions docs/advanced/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,20 @@ Using the 'target' extension to send requests without the standard path escaping
#
# Note that requests must still be valid HTTP requests.
# For example including whitespace in the target will raise a `LocalProtocolError`.
client = httpx.Client()
extensions = {"target": b"/test^path"}
response = httpx.get("https://www.example.com", extensions=extensions)
response = client.get("https://www.example.com", extensions=extensions)
```

The `target` extension also allows server-wide `OPTIONS *` requests to be constructed...

```python
# This will send the following request...
#
# CONNECT * HTTP/1.1
# OPTIONS * HTTP/1.1
client = httpx.Client()
extensions = {"target": b"*"}
response = httpx.request("CONNECT", "https://www.example.com", extensions=extensions)
response = client.request("OPTIONS", "https://www.example.com", extensions=extensions)
```

## Response Extensions
Expand Down
Loading