Understanding HTTP Methods & Statuses
Explore the standard HTTP methods (GET, POST, PUT, DELETE) and common HTTP status codes for REST APIs.
HTTP Methods: The Verbs of REST
HTTP methods are the verbs of REST — they tell the server the action you want on a resource: get, create, update, or delete data.
GET: Retrieving Resources
GET retrieves data. It’s safe and idempotent — repeat it and you get the same result — and it should never modify anything.
public class HttpGetDemo {
public static void main(String[] args) {
String resourcePath = "/api/products/123";
System.out.println("Simulating GET request for: " + resourcePath);
System.out.println("Expected: Server sends product details.");
}
}All lessons in this course
- Setting Up Your Spring Boot Project
- Building Your First REST Endpoint
- Understanding HTTP Methods & Statuses