beginnerREST Fundamentals

What is the difference between GET and POST in a REST API?

GET requests data and should never change server state — it's safe, idempotent, cacheable, and its parameters typically appear in the URL query string, which limits length and exposes them in logs/browser history. POST sends data in the request body to create a resource or trigger an action, is not idempotent (calling it twice may create two resources), and is not cached by default.

This is a Pro question

Sign in, then upgrade to Pro or Power to unlock this question and the full Interview Prep bank.

What is the difference between GET and POST in a REST API?

Next Step

Continue to What is the difference between @Component, @Service, @Repository, and @Controller?← Back to all Spring Boot & Microservices questions