Practice Lab

API Lab · class day 44

POST payloads

Send a JSON body in several ways: text, a Map, a JSONObject, a POJO or a file. The echo address shows what arrived.

Send X-Sandbox: your-name with every request to get your own data. Addresses start with /api/v1 after this site's address.

Addresses for today

MethodAddressWhat it doesStatus codes
POST/api/v1/echo
{"hello": "world", "list": [1, 2, 3]}
Sends back method, query, headers and body, and the body as JSON when it is JSON200 OK, 413 Body too big
PUT/api/v1/echo
{"a": 1}
The same as POST: PUT, PATCH and DELETE are echoed too200 OK