Portmint Lighthouse

Placing an Order — Requests

You've found the dish you want on the menu. Now you have to actually order it. The message your app sends to an API is called a request. It's the order slip the waiter carries to the kitchen.

A request is short and specific. It says where you're pointing, what you'd like done, and any extra details. Let's take those one at a time.

The verb: what you want done

Every request carries a verb — a single word saying what kind of action you want. These verbs have plain meanings once you translate them.

  • GET means "please hand me this." It's the most common one by far. Get today's weather. Get the directions. Get the list of coffee shops. You're asking to receive something, and you're not changing anything.
  • POST means "here's some information from me." You use it when you're sending something in, like submitting a form or saving a new note.

There are a few others (with names like PUT and DELETE), but you can go a long way knowing just these two. The verb is the difference between "show me the menu" and "place this order."

For everything in this course — checking weather, looking up a map — the verb is GET. You're asking to receive, not to change.

The address and the notes

We covered these last lesson, so just a quick recall. The request points at an endpoint (the address) and carries parameters (the notes). Together they make your order exact:

GET https://api.weather-example.com/today?city=Boston

Read aloud, that's: "Please hand me (GET) today's weather (the endpoint) for Boston (the parameter)." A complete, unambiguous order slip.

One extra layer: headers

There's one more part of a request worth meeting now: headers. Headers are small labels clipped to your order slip with extra context — not what you want, but background details about the request itself.

Think of the notes a waiter scribbles in the margin: "table 12," "regular customer," "allergic to nuts." Headers do that job for a request. Common ones quietly say things like:

  • what format you'd like the answer in
  • who you are (we'll meet this one properly in the lesson on keys)

You usually don't fuss over headers as a beginner. Just know they ride along on every request, carrying the side notes.

Sending it without writing code

Here's the friendly part: a plain GET request is just a web address. Your browser sends GET requests all day — that's what loading a page is. So you can place many simple API orders by pasting the address into your browser's bar and pressing enter.

When you do, you become the waiter for a moment: you hand the slip to the kitchen and wait for the plate. There are also tidy tools made just for this — one popular free one is called Postman — that let you build a request piece by piece and press "send." But the browser is enough to begin. 🔦

Your turn

Find a free, no-key-needed API online (search for "free public API no key" — several exist for jokes, facts, or public data). Read its docs to find one GET endpoint. Build the full address in your head: the endpoint, plus any notes after a ?.

Don't worry about the reply yet — just get comfortable assembling the order slip. In the next lesson, the plate comes back.

Stuck or curious?

Ask Pip about this lesson — tap the porthole bottom-right.