Curl is a useful program used to perform HTTP requests.
In Curl, we can call a HEAD request in various ways, including:
In the first case, the program executes a request the same way it would with a GET request, but it will not display its body.
For example, you can have the
Content-Length header without actually having a body. The program just asks for the headers and the closes the connection.
Let’s see an example:
In the second case, we are going to call a custom method. By default, it won’t print anything.
If we want to make a
HEAD request and print the results, we need to add the
Here is an example:
View all Courses