REST Playground

REST Learning App

Learn how REST methods differ in real use, not just in theory. This version now teaches GET, HEAD, POST, PUT, PATCH, DELETE, and OPTIONS, with a clear split between full replacement and partial updates.
API Base
/api
Methods
7
Resources
2

What you can practice

GET HEAD POST PUT PATCH DELETE OPTIONS
  • Compare collection and single-record reads
  • See how PUT replaces a whole resource
  • Use PATCH for just the fields you want to change
  • Inspect supported methods with OPTIONS and empty-body HEAD

Big semantic fix

PUT now behaves correctly. If you omit a required field, the API rejects the request. PATCH is the only partial update method.

Students and Employees

Refresh after POST, PUT, PATCH, or DELETE to verify the exact server-side result.
Students
Employees

Try these learning checks

  1. Run GET /api/students/1.
  2. Run PATCH /api/students/1 with only course.
  3. Run PUT /api/students/1 with just course and notice the validation error.
  4. Run PUT /api/students/1 again with all required fields to replace the resource.
  5. Run OPTIONS /api/students/1 to inspect allowed methods.

Run REST Call

Pick a method and endpoint, then send a matching JSON body when needed.
Quick presets

Response

Status, headers, and body from the live API
Run a request to see output...

REST Methods Explained

GET
Fetch data. Use it for collection reads and single-resource reads.
HEAD
Like GET, but without a response body. Handy for checking status and headers.
POST
Create a new resource. The server assigns the id.
PUT
Replace the whole resource at an id. Send every required field, not just the changed ones.
PATCH
Partially update a resource. Send only the fields you want to change.
DELETE
Remove a resource and inspect the confirmation payload.
OPTIONS
Ask the server which methods are supported for a route.

Sample Endpoints

GET /api GET /api/students HEAD /api/students POST /api/students OPTIONS /api/students GET /api/students/1 HEAD /api/students/1 PUT /api/students/1 PATCH /api/students/1 DELETE /api/students/1 OPTIONS /api/students/1 GET /api/employees HEAD /api/employees POST /api/employees OPTIONS /api/employees GET /api/employees/1 HEAD /api/employees/1 PUT /api/employees/1 PATCH /api/employees/1 DELETE /api/employees/1 OPTIONS /api/employees/1

PUT vs PATCH examples

// Correct PUT: full replacement PUT /api/students/1 { "name": "Aarav Sharma", "email": "aarav@example.com", "course": "Advanced REST" } // Correct PATCH: partial update PATCH /api/students/1 { "course": "Advanced REST" } // Incorrect PUT: rejected because fields are missing PUT /api/students/1 { "course": "Only one field" }

Semantics that matter

PUT = full replacement

This app now enforces classic PUT semantics. If a student needs name, email, and course, a PUT request must send all three.

PATCH = partial update

PATCH only changes the provided fields and leaves the rest untouched. It also rejects unknown fields to keep the lesson clear.

OPTIONS and HEAD

Use OPTIONS to inspect allowed methods and HEAD to test the route without returning a full payload body.

How to learn with this app

  1. Start with GET on a collection and then on a single id.
  2. Try HEAD on the same resource and compare the empty body with the headers.
  3. Create a record using POST.
  4. Use PATCH to change one field and verify that the other fields remain untouched.
  5. Use PUT with a complete object and notice that it replaces the resource cleanly.
  6. Use OPTIONS when you want to inspect what the route supports.
  7. Refresh the dashboard after each step to confirm the state change.