I plan to use a HTTP HEAD /products/{product_id}
request as a low bandwidth way to determine if a product exists.
If it does, I intend to return 204 No Content
. If it does not, I intend to return 404 Not Found
.
In my HTTP service there is some middleware that adds the Content-Type: application/json
.
The final response is
HTTP/1.1 204 No Content
Content-Type: application/json
Vary: Origin
Date: Wed, 07 Aug 2019 16:50:08 GMT
All other resources return JSON responses. Should I remove the Content-Type
header and does it matter for 204
and 404
type responses?