|
|
|
|
|
by gls2ro
1433 days ago
|
|
(I think debating is good and healthy, so let me do a short rebuttal about the difference between `/api/v11/employees/1` and `/api/v1/employees/100` with an example specifically because you say that you are talking about _HTTP_ APIs. So I will focus on HTTP then. Say you install an nginx/apache and then have a static structure where you have the profiles of employees saved as PDFs directly on the disk. Then you do `GET /public/v1/employees/1.pdf` and it works returns 200 with the content.
Then you do `GET /public/v11/employees/1.pdf` in this case all servers will return 404.
The same goes for `GET /public/v1/employees/100.pdf` will still be 404.
What if someone asks for `GET /public/v1/employeea/1.pdf` the server will again respond with 404. Then I go and I implement an webapp to replace that. I plan to keep the URLs the same but now there is an app that will return the .PDF as a datastream or file. For me, I don't see any reason why to change the behaviour of the URLs just because I replaced a static app with a dynamic web app. Any HTTP server will respond in the same way thus the current one should respond the same. Responding like this has a compatibility (let's say) reason behind that is not a personal nor related specifically to my project. |
|
It’s worth being redundantly explicit that this does not extend to all cases. There are cases where a 204 is warranted. But I’m roughly convinced that it may not be as ubiquitous as I thought. Very rad.