03: The Mailroom (POST)
Dispatching structured data packages to the server using JSON payloads.
POST Request Architecture
When you need to send complex data to a server—such as submitting a new project suggestion—you use a POST request. Unlike GET, the data is not in the URL; it is contained in the Request Body. To ensure the server processes this package correctly, we must define the Content-Type: application/json header.
Data Submission Lab
Objective: Submit a training module suggestion. Edit the JSON object below. Ensure your syntax is correct before dispatching.
1. Request Logic (JS)
Waiting...
2. Payload Headers
Waiting...
3. Server Response
Waiting for user dispatch...
Postman: Raw Body Configuration
In a professional environment, we use Postman to test POST payloads without a UI. Replicate this lab:
- Set Method to POST
- URL:
https://ohagan.au/api/training - Go to the Body tab and select raw.
- Change the type dropdown (usually 'Text') to JSON.
- Paste your JSON object and click Send.
Expected Result
{
"message": "Data Ingested",
"status": "Success",
"auth": "Verified"
}