Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MethodNames is a map of Method to string. MethodNames = map[Method]string{ MethodGet: "GET", MethodHead: "HEAD", MethodPost: "POST", MethodPut: "PUT", MethodDelete: "DELETE", MethodConnect: "CONNECT", MethodOptions: "OPTIONS", MethodTrace: "TRACE", MethodPatch: "PATCH", } // ErrMethodInvalid is returned if the HTTP method is invalid. ErrMethodInvalid = errors.New("invalid method") )
Functions ¶
This section is empty.
Types ¶
type Method ¶
type Method uint8
Method defines an HTTP method.
const ( MethodInvalid Method = iota // MethodGet // RFC 7231, 4.3.1 MethodHead // RFC 7231, 4.3.2 MethodPost // RFC 7231, 4.3.3 MethodPut // RFC 7231, 4.3.4 MethodDelete // RFC 7231, 4.3.5 MethodConnect // RFC 7231, 4.3.6 MethodOptions // RFC 7231, 4.3.7 MethodTrace // RFC 7231, 4.3.8 MethodPatch // RFC 5789 )
Common HTTP methods, these are defined in RFC 7231 section 4.3.
func MustParseMethod ¶
MustParseMethod parses method string or panics.
func (Method) MarshalJSON ¶
MarshalJSON method to json
func (*Method) UnmarshalJSON ¶
UnmarshalJSON method from json
Click to show internal directories.
Click to hide internal directories.