Backend Flashcards

(3 cards)

1
Q

How does a RESTful API work?

A

A RESTful API (Representational State Transfer) is an architectural style for building web services that interact with resources (like users, products, etc.) using standard HTTP methods. It treats data as resources, each identified by a unique URL.

A good RESTful API is stateless, consistent, and uses appropriate status codes (like 200 OK, 404 Not Found, 201 Created).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the most common HTTP methods used?

A

The main HTTP methods used are:

GET – Retrieve data (e.g., GET /users returns a list of users).

POST – Create new data (e.g., POST /users creates a new user).

PUT – Update or replace an existing resource (e.g., PUT /users/1 replaces the user with ID 1).

PATCH – Partially update a resource (e.g., PATCH /users/1 updates only the fields provided).

DELETE – Remove a resource (e.g., DELETE /users/1 deletes the user).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly