REST
31 → REST APIs
Previous: 30 JDBC → Next: 32 Standard Libraries
▶️ pkg12restapi/restapi1RestConcepts.java · restapi5HttpClientConsume.java
REST principles
| Concept | Rule |
|---|---|
| Resource | Noun in URL: /users/42 |
| HTTP verb | GET read, POST create, PUT replace, PATCH update, DELETE remove |
| Status codes | 200 OK, 201 Created, 400 Bad Request, 404 Not Found, 500 Server Error |
| Stateless | Each request carries all context (no server session) |
Build + consume
This package shows:
- REST design concepts
- Minimal HTTP server (
HttpServer) - JSON handling
- Client consumption with
HttpClient
Milestone project: File config · JDBC database · REST endpoint · call with HttpClient — scaffolded as Project 03 Todo REST.
Related → RestApis.md
Related → 15 Spring Boot
Next → 32 Standard Libraries
Source named in this chapter
- restapi1RestConceptspkg12restapi/restapi1RestConcepts.java