Should HEAD's response status code be the same as GET's status code?

865 Views Asked by At

As I know, HEAD is the same as GET, but without response body. If I request resource that doesn't exist, GET will response with 404 Not Found. What status code should return HEAD request in this case? 200 OK or 404 Not Found?

1

There are 1 best solutions below

0
On BEST ANSWER

As you said yourself, the response should be the same except there is no body.

This means that both the status and headers need to be the same as they would be for a GET request.