Making HTTP calls using IPv6

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:


Here's that working as a request to (hosted on which issues IPv6 addresses) using the httpx Python library:

>>> httpx.get("http://[2a09:8280:1::1:2741]", headers={"host": ""}).text
'<!DOCTYPE html>\n<html lang="en">\n<head>\n<title>Pillar Point Tidepool Stewards</title>\n<meta

Created 2022-06-08T15:58:28-07:00 · Edit