0

I would like to use the vendor mime type standard in the accept header to handle REST resource requests and versions. We expose a set of get methods for some resources, one returning an array of all or a subset of resources from a search or similar, and the second returning the specific resource if requested by its key value(s).

Array

GET .../api/orders?orderDate=2016-01-01
Accept: application/vnd.company.orders.v1+json

Single (OrderId = 12345)

GET .../api/orders/12345
Accept: application/vnd.company.order.v1+json

My question is whether there is a standard around mime types for plural vs. single responses. As shown above, I think that the mime type corresponding to the array response should be plural and single for single. I.e. orders vs. order.

I haven't been able to find anything on this, so any suggestions or links to standards or docs would be great, thanks.

  • `vnd` mimetypes are by definition not part of a standard (besides the `vnd` prefix). What you propose looks fine to me. –  Mar 01 '16 at 07:45

1 Answers1

0

There is the standard Atom protocol which somewhat fits the bill. There is also RSS. These are not exactly only collection types, but they are at least worth considering. (We ended up doing a custom collection format, which was much easier and non-XML)

Community
  • 1
  • 1
Robert Bräutigam
  • 7,514
  • 1
  • 20
  • 38