Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #19 from phederal/adding-head-request
Browse files Browse the repository at this point in the history
add head request method
  • Loading branch information
mychidarko authored Sep 2, 2024
2 parents dc37447 + 6ac63a7 commit a2a8143
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,17 @@ public static function delete(string $pattern, $handler)
static::match('DELETE', $pattern, $handler);
}

/**
* Add a route with HEAD method
*
* @param string $pattern The route pattern/path to match
* @param string|array|callable The handler for route when matched
*/
public static function head(string $pattern, $handler)
{
static::match('HEAD', $pattern, $handler);
}

/**
* Add a route that sends an HTTP redirect
*
Expand Down

0 comments on commit a2a8143

Please sign in to comment.