BolEnglishLearn · Play · Win
Login

🌐 API & Integration · APIs & Integration

🌐

REST

API ConceptCoreModule 5

An HTTP-based style commonly used to expose resources.

Use familiar HTTP methods and resource-oriented URLs.

💡 In practice

GET /customers/10 reads a customer; PATCH updates selected fields.

🖼️ CONCEPT PICTURE
A picture to help remember REST
GET /customers/10 reads a customer; PATCH updates selected fields.

💡 Think of nouns and verbs: the URL is the noun (the thing) and the HTTP method is the verb (what you do to it).

💡 Learn🛠️ Apply🎯 Check

💡 Why it matters

REST is widely understood, so an API that follows its conventions is easy for other developers to learn and use. Using the right HTTP method also signals intent clearly — GET is safe to repeat, DELETE removes. Following the style keeps APIs predictable and tool-friendly.

🛠️ How to achieve it

1
Name resources, not actions
Use nouns in URLs like /customers/10, and let the HTTP method express the action.
2
Pick the right method
GET to read, POST to create, PUT or PATCH to update, DELETE to remove.
3
Return meaningful status codes
Use codes like 200, 201, 404 and 400 so callers can react correctly.
4
Keep reads safe
A GET should never change data, so it can be retried or cached without harm.

⚠️ Signs of trouble

  • •URLs contain verbs like /getCustomer or /deleteOrderNow.
  • •GET requests change data on the server.
  • •Everything is a POST regardless of intent.
  • •Status codes are always 200, even on errors.
⚠️ Common mistake: Putting actions in the URL and using POST for everything. Model resources as nouns and let the HTTP method carry the verb.

🎯 Quick check

Score: 0/3

Three questions to test the idea.

  1. 1. In REST, how should a URL be structured?

    Answer: Around a resource noun, like /customers/10

    REST models resources as nouns in the URL and lets the HTTP method express the action.

  2. 2. Which HTTP method should be used to read data safely?

    Answer: GET

    GET is for reading and should not change data, so it can be safely retried or cached.

  3. 3. Why return meaningful status codes?

    Answer: So callers can tell success from failure and react

    Status codes like 200, 404 and 400 tell the caller what happened so it can handle each case correctly.

🔑 Key terms

Resource
A thing the API exposes, like a customer.
HTTP method
The verb: GET, POST, PUT, PATCH or DELETE.
Status code
A number saying how the request went, like 200 or 404.
PATCH
An update of only the fields you send.

✅ Review checklist

📊 Your progress

0%
Mark this topic learned to track it.
Saved in this browser.
🚀 Got it?
Mark it learned and move to the next topic.
Next topic →