-3

As we all aware the HTTP method has certain properties like, idempotent, safe and cache-able and its defined through HTTP specification by W3C.

My question is who is responsible to implement these HTTP properties. Is browser client, or the server, or both the browser and server which implement the properties of HTTP.

1 Answers1

0

The client asks for something. The server responds with something.

For it to be idempotent, you should expect to get the same response if you ask for the same thing. Only the server can decide what is in the response, so that has to be implemented by the server.

For it to be safe, the request must not alter the server. Only the server can decide to alter something or not based on the request.

Caching takes place on the client (it decides if it should make a request or not based on what data it already has). Only the client can make that decision. (Of course, the server is responsible for giving the client the information they need to make that decision).

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • Is it fair to say both Client and Server needs to implement the properties. The reason I am asking is, if we have POST request earlier and when we press refresh in the browser, the browser says, Are you going to post the data again? However, the same is not true for GET request. I would like to have the documentation links for the inference you have made. Appreciate your time and effort. – Kumaresan P May 02 '18 at 04:24
  • The browser asks for confirmation before reporting the data because the request is not "safe". It isn't the act of asking for confirmation that stops the request from being "safe". It is entirely up to the server to ensure if it is or is not. – Quentin May 02 '18 at 06:26
  • It's simple logic, not something that is clearly expressed in documentation. – Quentin May 02 '18 at 06:26