Closed LouisStAmour closed 6 years ago
I need to explain why I abandoned HEAD
and OPTIONS
.
In fact, I don't really want to abandon them, but want to merge them into GET
. Why? Because HEAD
and OPTIONS
are just the same as GET
to get some information from the server.
HEAD
: The thin version of GET
(without body).OPTIONS
: The variant version of GET
(fixed head and without body).My current solution is to add a custom HTTP request header to achieve the goal. Like Without-Body: true
used to tell the server to discard the response body. But I didn't finalize the solution. So welcome everyone to put forward their own views.
OPTIONS
is required for CORS Preflight: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/OPTIONSHEAD
is very useful for (custom) clients who want to check for the existence of a file without actually downloading it, e.g. link/image validation https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD