Are there any headers that you can send using an HTTP request that tells the web server to send you only headers in response and without body content?
I use cURL to execute such requests, but technically I assume that this should be possible when a simple header is sent as part of the request.
For example, there is a 304 Not Modified HTTP Response Code. When you send a request to the server with a cache tag or time and time information, the server can detect this and return headers as a response that says the user agent uses its cache as the response. This means that the response from the server is very, very small when it comes to bandwidth.
But is there a header that you can send to servers that force the server to return the header without the contents of the body?
The idea here is to make HTTP requests that would otherwise return a large amount of data, very small. For example, an API call that will return JSON data or a log, if in fact the user agent is the only one interested in making sure the request passes, and nothing more. This is done in order to minimize throughput on the server and from the server in those cases where the body can exist, but not necessarily in any way in the context of what the user agent does.
Although it would be possible to develop an API that would listen on a specific user-defined header or something else, I would prefer not to go this route unless I have to. But I could not find if there is a standardized way to make an HTTP request that tells the server not to send any body content?
kingmaple
source share