allow OPTIONS on json-ld API
Closed this issue · 3 comments
linked data clients use OPTIONS to see what kind of operations that they can do on a server. Because the json-ld export in the CE is read-only, we should implement OPTIONS that returns:
HTTP/1.1 204 No Content
Allow: OPTIONS, GET
so that clients know that they cannot write to the CE.
N.b. "Allow" is a header. See:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow
and
https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONS
From what I understand I think that we should do:
OPTIONS /:identifier -> return Allow: OPTIONS, GET
GET /:identifier -> return data (optionally add Allow: OPTIONS, GET)
POST /:identifier -> return method not allowed (optional add Allow: OPTIONS, GET)
I'm not sure if Allow: should also be included in the GET and POST methods, however the header should only appear in the /:identifier
route