From 3a27d20be05a64b3947e08b06d21aa7daff519ef Mon Sep 17 00:00:00 2001 From: Alaa Attya Date: Thu, 27 Jun 2019 11:39:03 +0200 Subject: [PATCH] support head and patch http request methods --- fdhttp/router.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fdhttp/router.go b/fdhttp/router.go index 94016ea..14c3c25 100644 --- a/fdhttp/router.go +++ b/fdhttp/router.go @@ -204,6 +204,16 @@ func (r *Router) StdOPTIONS(path string, handler http.HandlerFunc) *Endpoint { return r.StdHandler("OPTIONS", path, handler) } +// StdHEAD register a standard http.HandlerFunc to handle HEAD method +func (r *Router) StdHEAD(path string, handler http.HandlerFunc) *Endpoint { + return r.StdHandler("HEAD", path, handler) +} + +// StdPATCH register a standard http.HandlerFunc to handle PATCH method +func (r *Router) StdPATCH(path string, handler http.HandlerFunc) *Endpoint { + return r.StdHandler("PATCH", path, handler) +} + // Handler register the method and path with fdhttp.EndpointFunc func (r *Router) Handler(method, path string, fn EndpointFunc) *Endpoint { prefix := make([]string, 0)