ProLesson 2.2Intermediate4 min readUpdated 31 October 2026
Path Variables, Query Params, and Headers
Extract client data from URLs and HTTP headers using @PathVariable, @RequestParam, and @RequestHeader with safe defaults.
01Where client data lives
When an HTTP request arrives, client data can hide in three different places:
- The URL path:
/orders/9924(identifies a specific entity). - The query string:
/orders?status=SHIPPED&page=2(filters, sorts, or paginates a collection). - The HTTP headers:
X-Tenant-ID: veltoryx(metadata, auth tokens, device fingerprints).
Spring Boot provides clean, type-safe annotations to extract each of these effortlessly.
Loading the rest of the lesson…