Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Something nice about accept headers is you can have your own formats, and include versioning information. That means I can have a consumer specify it can process V2 and V3 formats of the API, and when the API is upgraded or downgraded around a release everything works smoothly. Your API can serve both but it doesn't have to - it can be easier to have clients support two versions than support long running parallel API versions.

I sometimes prefer file extensions, but then consuming code can often get filled with appending or removing or changing formats.

Broadly, I like content negotiation as a concept because it describes what you actually want and is much more typed (as far as it can be). Adding file extensions feels very stringly typed processing.

Both have problems, you pick your poison and look wistfully at the greener grass on the other side.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: