Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
# Level 2 response (typical production API) # GET /orders/55 # HTTP/1.1 200 OK # { # "id": 55, # "status": "PENDING", # "total": 149.99, # "customerId": 7 # } # Level 3 response (HATEOAS with HAL) # GET /orders/55 # HTTP/1.1 200 OK # Content-Type: application/hal+json { "id": 55, "status": "PENDING", "total": 149.99, "_links": { "self": { "href": "/orders/55" }, "cancel": { "href": "/orders/55/cancel", "method": "POST" }, "pay": { "href": "/orders/55/payment", "method": "POST" }, "customer": { "href": "/users/7" }, "items": { "href": "/orders/55/items" } }, "_embedded": { "customer": { "id": 7, "name": "Alice", "_links": { "self": { "href": "/users/7" } } } } } # The client discovers available actions from _links — # no hardcoded URL knowledge required. # If order is already CANCELLED, the "cancel" link is absent.
Result
Open