2 ms·
There 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 C
by niftich 10y ago
There 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...