REST Principles, HTTP Methods and Status Codes
40 min · Intermediate
REST (Representational State Transfer) is a style for designing web APIs around resources (products, orders) identified by URLs and handled with standard HTTP methods. Every Java backend interview asks REST basics, status codes and "design the endpoints for...". Section 14 (Web Fundamentals, HTTP & REST APIs) taught this with the ShopLite API; this lesson is the revision.
Topics in this lesson
- REST constraints and resource naming
- HTTP methods; safe and idempotent
- Status codes interviewers ask
- PUT vs PATCH, path vs query parameters, stateless and sessions
- Design question: endpoints for a ShopLite order
Interview questions this lesson answers
- What is REST?
- What are the REST constraints?
- What is the difference between REST and SOAP?
- What is a resource and a representation?
- What are the main HTTP methods and what does each do?
- What does safe mean for an HTTP method?
- What does idempotent mean? Which methods are idempotent?
- Why is POST not idempotent, and how do you make payments safe to retry?
- What is the difference between PUT and POST?
- What is the difference between PUT and PATCH?
Sign in free to continue this lesson
Create a free account to read every lesson, practise with the exercises and keep track of your progress.