Recommend the correct HTTP method for tags

The existing guideline recommends to do a GET on a tag to check its
existence, while our HTTP guideline recommends HEAD for such checks.
Since this is just a check, we should recommend HEAD in this case.
Wording was also added to the HTTP guideline stating that in all cases
where HEAD is implemented, the corresponding GET must be implemented,
too.

Closes-Bug #1677360

Change-Id: I36045e84e906dfbdf60c8989e2a5a5fb39b7cc34
This commit is contained in:
EdLeafe 2017-03-29 19:24:07 +00:00
parent 6cf4e1deca
commit 3ec748370d
2 changed files with 5 additions and 1 deletions

View File

@ -257,6 +257,10 @@ More generally, CRUD models the four basic functions of persistent
storage. An HTTP API is not solely a proxy for persistent storage.
It can provide access to such storage, but it can do much more.
Please note that while HEAD is recommended for checking for the existence of a
resource, the corresponding GET should always be implemented too, and should
return an identical response with the addition of a body, if applicable.
**TODO**: HEAD is weird in a bunch of our wsgi frameworks and you
don't have access to it. Figure out if there is anything useful
there.

View File

@ -182,7 +182,7 @@ Response::
Location: http://example.com:8774/servers/1234567890/tags/qux
<no body>
To check if a tag exists or not, the client should send a GET request to the
To check if a tag exists or not, the client should send a HEAD request to the
individual tag URL. If the tag exists, the server responds with a status code
204 and no response body. If the tag does not exist, the server responds with
a status code 404.