4 ms·
> Tricks like appending ".jpg" to the url seem a little hack-ish to me. That feels like a parameter. that feels like a file type. If there is more than one rep
by tjpick 17y ago
> Tricks like appending ".jpg" to the url seem a little hack-ish to me. That feels like a parameter.
that feels like a file type. If there is more than one representation available then it's a parameter, indeed, but the standard place to put that is on the end of the filename.
Surely it's clear that:
employees is the collection;
employees/110 is a specific employee;
employees/110.jpg is the jpeg representation of said employee.
- akronim 17y agoShouldn't you be using HTTP Accept headers to specify the format(s) you want? (rather than file extensions in the URL)
- tjpick 17y agothe spec says they can be used for that and you could easily have a server that checks the HTTP Accept if there is no extension. Most likely you need to hyperlink to many of the resources so you're going to need the extension anyway (eg /employees/110.html has an img src="employees/110.jpg") If it's for a programmatic client, not a browser, the HTTP Accept would probably be sufficient.