Skip to main content
InterviewHubPRO
Section Overview
Q11

Question 11 of 50

Part 2: Persistence, Transactions & Security (11 - 24)

22%
Spring Boot & Microservices (50 Qs)•Part 2: Persistence, Transactions & Security (11 - 24)

What is the difference between `@RequestParam`, `@PathVariable`, and `@RequestBody`?

junior LevelState ManagementSecurity & AuthDatabases & SQL

In Simple Words:

  • @PathVariable: Extracts values from URI template path (e.g., /orders/{id} -> @PathVariable UUID id).
  • @RequestParam: Extracts query parameters (e.g., /orders?status=active&page=2 -> @RequestParam String status).
  • @RequestBody: Deserializes JSON HTTP payload into a Java POJO/Record using Jackson.