I am working on REST specifications to support [SPECPR-307] Add has_xxx operations to the REST API spec - openEHR JIRA.
The idea is to add
HEAD method, similar to
GET, to check whether a resource exists, but without returning any content in the body, just http status 200 or 404.
Although I understand the need from SM perspective, described in openEHR Platform Service Model, I wonder what is the real value in REST APIs. If
HEAD returns only 200/404, there is only a network/traffic optimization, but clients would still have to make 2 requests (
GET) to get a single resource, and the server would still have to consult 2 times internal persistence layer. I can imagine another approach is to just treat
GET 404 errors gracefully.
If on the other hand the
HEAD would return also version-id headers besides 200 status, then I can see a use-case where clients may “check” for
version_uid updates, so that in case of an update they populate the right
preceding_version_uid in the
Does implementers have real use-cases or any opinion on this aspect?