Skip to content

Commit 79b742f

Browse files
committed
Update httpx code to follow redirects
A breaking change from awhile ago with httpx.
1 parent df3ae0b commit 79b742f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/py/ch10_async/ascrape.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async def get_html(n: int) -> str:
2121

2222
# The "async with" syntax ensures that all active connections are closed on exit.
2323
async with httpx.AsyncClient() as client:
24-
resp = await client.get(url)
24+
resp = await client.get(url, follow_redirects=True)
2525
resp.raise_for_status()
2626

2727
return resp.text

0 commit comments

Comments
 (0)