How web applications work.
WHAT A REQUEST CONTAINS
A method, indicating the intent A path Headers Sometimes a body, carrying submitted data
WHAT THE COMMON METHODS MEAN
Retrieving something Submitting something that changes state
WHY THAT DISTINCTION MATTERS
Retrieval should not change anything.
A link that deletes something is a design error, and it will be triggered by crawlers.
WHAT A RESPONSE CONTAINS
A status code Headers A body
WHAT STATUS CODES INDICATE
Success Redirection A problem with the request A problem on the server
WHY YOU SHOULD RETURN THE RIGHT ONE
Clients and tools behave according to it.
Returning success for a failure breaks everything downstream.
WHAT TO RETURN FOR A MISSING RESOURCE
The not-found status, not a success page saying nothing was found.
WHAT ROUTING DOES
Maps a path to the code handling it.
WHAT TO KEEP IN HANDLERS
As little logic as possible.