REST

31 → REST APIs

Previous: 30 JDBCNext: 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:

  1. REST design concepts
  2. Minimal HTTP server (HttpServer)
  3. JSON handling
  4. 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