MCPcopy Index your code
hub / github.com/go-spring/go-spring / shouldParseBody

Function shouldParseBody

stdlib/httpsvr/handler.go:49–56  ·  view source on GitHub ↗

shouldParseBody determines whether the incoming HTTP method is expected to carry a request body that should be parsed.

(method string)

Source from the content-addressed store, hash-verified

47// shouldParseBody determines whether the incoming HTTP method
48// is expected to carry a request body that should be parsed.
49func shouldParseBody(method string) bool {
50 switch method {
51 case http.MethodPost, http.MethodPut, http.MethodPatch:
52 return true
53 default:
54 return false
55 }
56}
57
58// ReadBody reads the request body into a byte slice.
59// Users can customize the ReadBody function.

Callers 1

ReadRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected