REST APIs and HTTP Methods Flashcards

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/21

flashcard set

Earn XP

Description and Tags

Flashcards covering REST APIs, HTTP methods, and related concepts for exam preparation.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

22 Terms

1
New cards

What does REST stand for, and what is it?

Representational State Transfer; a standard for systems to communicate over the web using HTTP methods.

2
New cards

What does API stand for, and what does it do?

Application Programming Interface; a set of rules that allows different programs to communicate with each other.

3
New cards

What format do REST APIs typically send data in?

JSON (JavaScript Object Notation)

4
New cards

What does it mean that REST APIs are stateless?

No memory is stored; each request is brand new.

5
New cards

What characterizes the routes used by REST APIs?

Clear, predictable routes, such as /api/trucks.

6
New cards

What is commonly used on the frontend to send data in a REST API?

Axios

7
New cards

How does the backend (Spring Boot) receive data sent from the frontend in a REST API?

Matching @mapping annotations in the Spring Boot Controller class.

8
New cards

Which Spring annotation is used to handle HTTP GET requests?

@getMapping

9
New cards

Which Spring annotation is used to handle HTTP POST requests?

@postMapping

10
New cards

Which Spring annotation is used to handle HTTP PUT requests?

@putMapping

11
New cards

Which Spring annotation is used to handle HTTP DELETE requests?

@deleteMapping

12
New cards

What is the purpose of the axios.get() method and the corresponding @getMapping annotation?

To fetch data.

13
New cards

What is the purpose of the axios.post() method and the corresponding @postMapping annotation?

To create new data.

14
New cards

What is the purpose of the axios.put() method and the corresponding @putMapping annotation?

To update existing data.

15
New cards

What is the purpose of the axios.delete() method and the corresponding @deleteMapping annotation?

To remove/delete existing data.

16
New cards

What do HTTP requests from the frontend using Axios signify to the backend?

They let the backend know what Java method to run when the frontend sends data using specific HTTP methods.

17
New cards

What is routing in the context of APIs?

How API endpoints are organized, often starting with /api/.

18
New cards

What does the /api prefix in a route like /api/trucks indicate?

Signals that it's an API route.

19
New cards

In the route /api/trucks, what does /trucks refer to?

Refers to the truck entity (what is being created, read, updated, or deleted).

20
New cards

What does the @RequestBody annotation do in Spring?

Tells Spring to map the body of the HTTP request into a Java object.

21
New cards

When is the @RequestBody annotation typically used?

When expecting JSON input from the frontend (POST or PUT requests).

22
New cards

When is it not necessary to use the @RequestBody annotation?

A GET request with no body.