MCPcopy Create free account
hub / github.com/cloudflare/cfssl / NewMethodNotAllowed

Function NewMethodNotAllowed

errors/http.go:22–24  ·  view source on GitHub ↗

NewMethodNotAllowed returns an appropriate error in the case that an HTTP client uses an invalid method (i.e. a GET in place of a POST) on an API endpoint.

(method string)

Source from the content-addressed store, hash-verified

20// an HTTP client uses an invalid method (i.e. a GET in place of a POST)
21// on an API endpoint.
22func NewMethodNotAllowed(method string) *HTTPError {
23 return &HTTPError{http.StatusMethodNotAllowed, errors.New(`Method is not allowed:"` + method + `"`)}
24}
25
26// NewBadRequest creates a HttpError with the given error and error code 400.
27func NewBadRequest(err error) *HTTPError {

Callers 3

ServeHTTPMethod · 0.92
TestHTTPFunction · 0.85
TestHTTPErrorStringFunction · 0.85

Calls 1

NewMethod · 0.80

Tested by 2

TestHTTPFunction · 0.68
TestHTTPErrorStringFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…