3 ms·
If I use turning a lamp on and off, I'd do GET /lamp and in the response there should be an href with a rel of "on" that I can follow (in JSON land). In HTML,
by rswail 3y ago
If I use turning a lamp on and off, I'd do GET /lamp and in the response there should be an href with a rel of "on" that I can follow (in JSON land).
In HTML, I might have a FORM that does a POST of the lamp's switch to /lamp/switch.
Because the switch is the resource that you're trying to manipulate when turning a lamp on/off, not the lamp itself.
- 3cats-in-a-coat 3y agoPOST /lamp/switch is not any better than POST /lamp as neither communicates what you're doing.