3 ms·
I don't understand the point of "uri":"/transactions/1". Isn't the new resource's URI already part of the response (in the Location: header)? It's sort of like
by decklin 15y ago
I don't understand the point of "uri":"/transactions/1". Isn't the new resource's URI already part of the response (in the Location: header)? It's sort of like saying GET /posts/show/1 vs. GET /posts/1.
- icebraining 15y agoI agree, it's redundant.
- stanleydrew 15y agoIt's redundant in that particular instance. But it's a representation of a resource. It might be nice to define the representation across your entire system so that when you grab a transaction resource with a GET later, it still has that URI in it. Or maybe not. But it's not obvious that this is a bad idea.
- icebraining 15y agoBut to access that JSON document with the URI, you had to know the URI already (in this case, by following the Location header). It's like having a link on a webpage to itself, what's the point? I can just refresh.