Week 6 • Monday

Block 51: HTTP Basics & GET Requests

Understand HTTP and make your first API call with requests.

Concepts

Code Examples

See exercise below.

Exercise

Call a public API (e.g., Open-Notify ISS location or Random User). Print the JSON response. Print the status code and confirm it's 200 before using the data.

Homework

What is the difference between a 200, 404, and 500 status code? Give a real-world analogy.