Skip to content

Commit a353f3a

Browse files
authored
Making HTTP calls using IPv6
1 parent aefec9b commit a353f3a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

networking/http-ipv6.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Making HTTP calls using IPv6
2+
3+
Tiny TIL today: I learned how to make an HTTP call to an IPv6 address. The trick is to enclose the address in the URL in square braces:
4+
5+
http://[2a09:8280:1::1:2741]
6+
7+
Here's that working as a request to www.pillarpointstewards.com (hosted on [Fly.io](https://fly.io/) which issues IPv6 addresses) using the [httpx](https://www.python-httpx.org/) Python library:
8+
```pycon
9+
>>> httpx.get("http://[2a09:8280:1::1:2741]", headers={"host": "www.pillarpointstewards.com"}).text
10+
'<!DOCTYPE html>\n<html lang="en">\n<head>\n<title>Pillar Point Tidepool Stewards</title>\n<meta
11+
```

0 commit comments

Comments
 (0)