Rest Questions
Rest Questions
2. What does REST stand for, and what are its key principles?
- REST stands for Representational State Transfer. Its key principles are
statelessness, client-server architecture, cacheability, uniform interface, and
layered system.
3. What are the key HTTP methods used in REST, and what do they do?
- GET: Retrieve data.
- POST: Create new resources.
- PUT: Update or replace resources.
- DELETE: Remove resources.
- PATCH: Partially update resources.
7. What are the typical response codes used in REST APIs, and what do they
signify?
- 200 OK: Request successful.
- 201 Created: Resource created.
- 204 No Content: Request successful, no content to return.
- 400 Bad Request: Invalid request.
- 404 Not Found: Resource not found.
- 500 Internal Server Error: Server error.
12. What is the difference between JSON and XML in REST APIs?
- JSON is lightweight, easy to parse, and more commonly used. XML is more
verbose and supports richer data structures but is less efficient.