4 ms·
Well that's exactly what I need: A format that communicates structured data, friendly with GET requests and backward compatible with query string encoding. Why
by themihai 10y ago
Well that's exactly what I need: A format that communicates structured data, friendly with GET requests and backward compatible with query string encoding. Why there is no such format/standard yet? Is it that unusual?
- niftich 10y agoThere are ready-made mediatypes to communicate collections; some have even been registered as mediatypes with IANA. A simple one that would meet your needs is Collection+JSON [1]. There are others. This blog post [2] from 2014 lists some from a hypermedia perspective, although you may find some of these formats excessive for what you're trying to accomplish. Before JSON became a favorite for HTTP APIs, there used to be XML-based ones as well. AtomPub is a very good protocol, which defines an 'application/atomcoll+xml' mediatype for collections [3] [1] http://amundsen.com/media-types/collection/ http://amundsen.com/media-types/collection/ [2] http://sookocheff.com/post/api/on-choosing-a-hypermedia-format/ http://sookocheff.com/post/api/on-choosing-a-hypermedia-form... [3] http://bitworking.org/projects/atom/draft-ietf-atompub-protocol-04.html#collection_resource http://bitworking.org/projects/atom/draft-ietf-atompub-proto...