aboutsummaryrefslogtreecommitdiff
path: root/lib/http/request_method.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/http/request_method.go')
-rw-r--r--lib/http/request_method.go45
1 files changed, 10 insertions, 35 deletions
diff --git a/lib/http/request_method.go b/lib/http/request_method.go
index 120fd55e..af0ade82 100644
--- a/lib/http/request_method.go
+++ b/lib/http/request_method.go
@@ -9,42 +9,17 @@ import (
)
// RequestMethod define type of HTTP method.
-type RequestMethod int
+type RequestMethod string
// List of known HTTP methods.
const (
- RequestMethodGet RequestMethod = iota
- RequestMethodConnect
- RequestMethodDelete
- RequestMethodHead
- RequestMethodOptions
- RequestMethodPatch
- RequestMethodPost
- RequestMethodPut
- RequestMethodTrace
+ RequestMethodConnect RequestMethod = http.MethodConnect
+ RequestMethodDelete RequestMethod = http.MethodDelete
+ RequestMethodGet RequestMethod = http.MethodGet
+ RequestMethodHead RequestMethod = http.MethodHead
+ RequestMethodOptions RequestMethod = http.MethodOptions
+ RequestMethodPatch RequestMethod = http.MethodPatch
+ RequestMethodPost RequestMethod = http.MethodPost
+ RequestMethodPut RequestMethod = http.MethodPut
+ RequestMethodTrace RequestMethod = http.MethodTrace
)
-
-// String return the string representation of request method.
-func (rm RequestMethod) String() string {
- switch rm {
- case RequestMethodGet:
- return http.MethodGet
- case RequestMethodConnect:
- return http.MethodConnect
- case RequestMethodDelete:
- return http.MethodDelete
- case RequestMethodHead:
- return http.MethodHead
- case RequestMethodOptions:
- return http.MethodOptions
- case RequestMethodPatch:
- return http.MethodPatch
- case RequestMethodPost:
- return http.MethodPost
- case RequestMethodPut:
- return http.MethodPut
- case RequestMethodTrace:
- return http.MethodTrace
- }
- return ""
-}