4.2. Specifying Server Behaviour
4.2. Specifying Server Behaviour
The server's requirements define what implementations need to do to be compliant. When specifying server behaviour, it's essential to clearly define:
-
what requests the server should accept and what responses it should send;
-
what state the server is allowed to keep, if any, between requests (see Section 4.10);
-
what resources the server should make available and what their semantics are; and
-
what protocol elements (methods, status codes, header fields, and content) the server should use and how.
To allow the application to evolve, specifications SHOULD allow servers to accept new forms of requests not explicitly specified. This might manifest as additional request content, new header fields, or new URIs.
Similarly, specifications SHOULD NOT prohibit servers from sending unexpected status codes or additional header fields in responses, but they SHOULD give guidance on how clients are expected to handle them (often, "ignore what you don't understand").