

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: HTTP Methods - GET
incomplete
2: Why Use HTTP Methods?
incomplete
3: POST Requests
incomplete
4: Status Codes
incomplete
5: Status Code Property
incomplete
6: PUT
incomplete
7: PATCH vs. PUT
incomplete
8: Delete
incomplete
This lesson's interactive features are locked, please to keep using them
HTTP defines a set of methods. We must choose one to use each time we make an HTTP request. The most common ones include:
GETPOSTPUTDELETEThe GET method is used to "get" a representation of a specified resource. It doesn't take (remove) the data from the server but rather gets a representation, or copy, of the resource in its current state. A GET request is considered a safe method to call multiple times because it shouldn't alter the state of the server.
Normally, I'd recommend using the requests library for making HTTP requests in your python code. However in this course, we have been and will continue to use PyFetch. That's just because Boot.dev's code editor uses a WASM based Python distribution for the browser and there is only slight syntax differences between the two libraries.
The pyfetch() function accepts parameters that we can use to define things like:
method: The HTTP method of the request, like GET.headers: The headers to send.body: The body of the request. Often encoded as JSON.Example GET request using pyfetch:
await pyfetch(
url,
method="GET",
headers={
"X-API-Key": "your-api-key",
},
)
We need to write a reusable function that retrieves all of the Jello users from our server.
Complete the get_users(url: str, api_key: str) -> list[User] function. It should:
We've done this all before, but now you're writing it all from scratch!