DEV Community

Discussion on: Why you should use standard HTTP methods when designing REST APIs

Collapse
 
suhas_chatekar profile image
Suhas Chatekar

It really depends on how your resources are represented.

One way to keep PUT still idempotent in that case would be to treat updated_at as a server generated value which the client has no control over, which is actually true in most cases. The from a client's perspective, the resource representation they send to the server is same every time and server can respond in an idempotent manner.

Collapse
 
aleron75 profile image
Alessandro Ronchi

Ok, that means that a GET shouldn't return the 'updated_at' attribute?
Sorry if I bother :)

Thread Thread
 
suhas_chatekar profile image
Suhas Chatekar

Why should it not?

Resource for PUT and GET can look different.

Thread Thread
 
aleron75 profile image
Alessandro Ronchi

Why should not

Just asking :)

Thank you for your clarification, it was very useful