diff --git a/TigoWeb/enums.go b/TigoWeb/enums.go index 23288f7..07765ae 100644 --- a/TigoWeb/enums.go +++ b/TigoWeb/enums.go @@ -2,26 +2,45 @@ package TigoWeb const Version = "1.6.5" +const ( + httpLowerGet = "get" + httpLowerHead = "head" + httpLowerPost = "post" + httpLowerPut = "put" + httpLowerDelete = "delete" + httpLowerConnect = "connect" + httpLowerOptions = "options" + httpLowerTrace = "trace" + httpUpperGet = "GET" + httpUpperHead = "HEAD" + httpUpperPost = "POST" + httpUpperPut = "PUT" + httpUpperDelete = "DELETE" + httpUpperConnect = "CONNECT" + httpUpperOptions = "OPTIONS" + httpUpperTrace = "TRACE" +) + // MethodEnum 根据http请求方式获取对应的函数名 // - httpMethod: http请求方式 func MethodEnum(httpMethod string) string { var MethodMapping = map[string]string{ - "get": "Get", - "head": "Head", - "post": "Post", - "put": "Put", - "delete": "Delete", - "connect": "Connect", - "options": "Options", - "trace": "Trace", - "GET": "Get", - "HEAD": "Head", - "POST": "Post", - "PUT": "Put", - "DELETE": "Delete", - "CONNECT": "Connect", - "OPTIONS": "Options", - "TRACE": "Trace", + httpLowerGet: "Get", + httpLowerHead: "Head", + httpLowerPost: "Post", + httpLowerPut: "Put", + httpLowerDelete: "Delete", + httpLowerConnect: "Connect", + httpLowerOptions: "Options", + httpLowerTrace: "Trace", + httpUpperGet: "Get", + httpUpperHead: "Head", + httpUpperPost: "Post", + httpUpperPut: "Put", + httpUpperDelete: "Delete", + httpUpperConnect: "Connect", + httpUpperOptions: "Options", + httpUpperTrace: "Trace", } return MethodMapping[httpMethod] }