4 ms·
Never so that funny interpretation of REST(ish) architecture. That R in the name is a dead giveaway that you not necessarily will get exactly what you put there
by rimantas 10y ago
Never so that funny interpretation of REST(ish) architecture.
That R in the name is a dead giveaway that you not necessarily will get exactly what you put there. I may put json and request xml, what are you gonna do, stab me?
- einrealist 10y agoWell, if the server understands the payload, it can return it in a different representation. There is nothing wrong with that. But a GET should always return the original payload when requested with the Accept header that matches the original Content-Type of the PUT request. edit: Better is to use a PUT for different representations: PUT /foo Content-Type: application/json {"foo":""} PUT /foo Content-Type: text/xml <foo></foo>
- wvenable 10y agoSeems to be no reason why GET should return the original payload. No client should even expect that as the resource could easily have been changed by another client in between requests.
- einrealist 10y agoObvious, but thats not the point.
- wvenable 10y agoWhat is the point? GET isn't even guaranteed to return the same payload every time, without PUT. Look at this website for example. The idea that you need to PUT something that be GET in exactly the same representation makes no sense given these basic facts.