Email or username:

Password:

Forgot your password?
Top-level
Helge Heß

@simon I love accept headers, they get you the most suitable response the client can process. If you want to spoof them, you can easily do that using a proxy?

4 comments
Simon Willison

@helge the only place I like them is for media files (audio, video, image) where you might want to serve back e.g. a smaller .webp file but only to browsers that support it

For APIs they drive me up the wall, because I'm often doing API research from devices (like my phone) that don't have a convenient terminal to hand

Helge Heß

@simon I think it is useful to have resource variants that are also addressable by URL, like /calendar/x/1.ics vs /calendar/x/1.html or /calendar/x/1.json. But that you can have /calendar/x/1 and have that resource serving the proper thing via Accept, is an HTTP superpower to me.

Simon Willison

@helge I get the theory, but in twenty years of mucking around on the Web I've never actually seen real concrete benefit from APIs that do that - I've just found it frustrating

Helge Heß

@simon Fair, I don't think I ever really relied on content negotiation either 🙈 My opinion is that a good setup should support both, accept and extension based type lookup.

Go Up