2 ms·
This is not about requesting the content type though, it's about requesting the format of the content. If I make a request to https://api.github.com/users/domin
by ddagradi 15y ago
This is not about requesting the content type though, it's about requesting the format of the content. If I make a request to https://api.github.com/users/dominic/gists https://api.github.com/users/dominic/gists, I'm getting back JSON, since that's all Github's API supports.
Github's custom mime types allow you to request the content of the response in a specific format. In their case, either in Github Flavored Markdown, text, html, or all of the above. They allow you to do this with an Accept header, but the same could be accomplished with a GET parameter tacked onto the request (but that's not RESTful at all!). Using HTTP headers appropriately feels like exactly the right way to handle this situation.