I recently found a REST api which didn't support HEAD (i.e. Method not supported) but that supported GET.
Should HEAD always be supported in REST clients?
Or are there valid reasons to support GET without supporting HEAD ?
I recently found a REST api which didn't support HEAD (i.e. Method not supported) but that supported GET.
Should HEAD always be supported in REST clients?
Or are there valid reasons to support GET without supporting HEAD ?
The reason for not supporting it is api users do not use it or expect it to be implemented. Whether it is valid or not is up to you. Does your api give huge GET responses? HEAD might be used to check for changes so that cache can be used instead of a full GET request.
There is no REST RFC standard, but HTTP standard actually states this:
All general-purpose servers MUST support the methods GET and HEAD.
All other methods are OPTIONAL.
This does not mean that your api must respond with anything real. You can answer with 405 all the time if you do not implement it.