Search⌘ K
AI Features

How Not To Fetch Data Over HTTP

Understand how to download resources over HTTP in Python and why simple urlopen().read() calls can be inefficient for repeated requests. Explore correct handling of bytes and character encoding and learn techniques for polite and efficient web service interactions.

We'll cover the following...

Let’s say you want to download a resource over HTTP, such as an Atom feed. Being a feed, you’re not just going to download it once; you’re going to download it over and over again. (Most feed readers will check for changes once an hour.) Let’s do it ...