Question

I am searching for a good way to handle requests for metadata associated with specific REST requests.

For example http://example.net/SomeModule/GetListOfData returns a JSON list and I search for a way to deliver metadata about that data - for example the translated readable field names or the exact datatype of the fields.

The solution which I would see as the most natural one, has the problem that it would involve creating a custom HTTP verb like "META". As far as I can tell this is not against the HTTP Standard but also not really ideal. Also I don't know how proxys or different clients (especially the JavaScript-Stack of different browsers) would handle it.

Another way would be to use a custom HTTP-Header, but this would give the same URL and HTTP-Method totally different meanings based only on an HTTP-Header.

And the third option I thought about is appending a postfix to the URL itself, like http://example.net/SomeModule/GetListOfData_Metadata - it does not have the problems of the above mentioned approaches, but it just does not seem right to me.


Has anyone successfully implemented such a system or run into a pitfall while solving it? Or is there an different way to solve the problem I have not thought about?

Was it helpful?

Solution

PROPFIND? Link header field pointing to metadata? Content negotiation?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top