The REST API uses certain methods to implement some actions and below are simplified explanations from the perspective of a user that’s a teacher.
GET: This method is used to get data from your server.
PRACTICAL EXAMPLE: attempting to get the general data of your students as a teacher.
@GetMapping
(path= "/students")
POST: This method is used to create resource(s) to your server.
PRACTICAL EXAMPLE: posting the grades for the students in your class as a teacher:
@PostMapping
(path= "/students/grades")
PUT: This method is used to modify or adjust resource(s) to your server. PRACTICAL EXAMPLE: adding more points to modify the grades for your students in your class as a teacher.
@GetMapping
(path= "/students/grades/updateGrades")
DELETE: This method is used to delete resource(s) from your server. PRACTICAL EXAMPLE: deleting the data of all the students in your class as a teacher.
@DeleteMapping
(path="/students/")