When I do php artisan routes
, the GET
request of my app has a |HEAD
. What is the purpose of having |HEAD
?
Following function is taken from the Laravel'
s Illuminate\Routing\Router.php
class, when you use Route::get()
method to add a route for your site/application, Laravel
adds both methods for the url
, it means that, these url
s registered using get
method could be accessed using both GET
and HEAD
HTTP
method, and HEAD is just another HTTP
verb/method, used for making a HEAD
request.
/**
* Register a new GET route with the router.
*
* @param string $uri
* @param \Closure|array|string $action
* @return \Illuminate\Routing\Route
*/
public function get($uri, $action)
{
return $this->addRoute(array('GET', 'HEAD'), $uri, $action);
}