closeio / flask-mongorest

Restful API framework wrapped around MongoEngine
Other
522 stars 88 forks source link

add 'pagination': { 'next': <url> } to List requests in MongoRest #8

Open philfreo opened 12 years ago

xogeny commented 11 years ago

I think HAL (or any of the many JSON hypermedia formats out there, like Siren) would be a good way to "standardize" this kind of thing. Even better (and I'm working on this in #27) would be to be able to response to requests in all of those formats automatically. In other words, write code so that if the client wants HAL, they add an "Accept: application/hal+json" to their request, and they get HAL. But they could also ask for Siren, Collection+JSON, hm-JSON, etc and they'd get their response in those formats. I think you could support all of these formats "out fo the box".

philfreo commented 11 years ago

This seems like a good approach:

http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api?hn#pagination