Re:Why I Tend Not to Use Content Negotiation
by euroderf on Monday November 20, 2023 @02:09AM
(#38343755)
But doesn't << /fred.md >> beat the heck out of something like << /fred?format=md >>?
[ Parent
| on HN ]
Re:Why I Tend Not to Use Content Negotiation
by incrudible on Monday November 20, 2023 @04:35AM
(#38345446)
From a URL aesthetics perspective, yes. Otherwise it just adds yet another dimension of how to pass a parameter.
Re:Why I Tend Not to Use Content Negotiation
by capableweb on Monday November 20, 2023 @07:11AM
(#38346880)
Depends. Including it in the location part of the URL could make it harder to understand if you have multiple parameters, instead of just one. Using query parameters makes it very explicit, which can be good or bad depending on your use case, while sticking it into the URL makes it implicit.
Together with that, you can also go for putting it in the `hash` part of the URL, if you want to keep it a secret from the server, as the server doesn't receive those parts, `/fred/#format=md`. In this case, it doesn't make much sense, but useful to know for other things, like keys and whatnot.
Re:Why I Tend Not to Use Content Negotiation
by matt-attack on Wednesday November 22, 2023 @04:50PM
(#38385637)
Is don’t think I that hash method would work since that part of the URL isn’t sent to the server. It’s strictly used by the client to decide which part of the response we to show.
Server has no need for it.