Skip to content

Commit

Permalink
support head and patch http request methods
Browse files Browse the repository at this point in the history
  • Loading branch information
AlaaAttya committed Jun 27, 2019
1 parent 941b70c commit 3a27d20
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fdhttp/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3a27d20

Please sign in to comment.