MCPcopy Create free account
hub / github.com/imroc/req / requestMethodUsuallyLacksBody

Function requestMethodUsuallyLacksBody

http_request.go:109–115  ·  view source on GitHub ↗

requestMethodUsuallyLacksBody reports whether the given request method is one that typically does not involve a request body. This is used by the Transport (via transferWriter.shouldSendChunkedRequestBody) to determine whether we try to test-read a byte from a non-nil Request.Body when Request.outgo

(method string)

Source from the content-addressed store, hash-verified

107// Request.outgoingLength() returns -1. See the comments in
108// shouldSendChunkedRequestBody.
109func requestMethodUsuallyLacksBody(method string) bool {
110 switch method {
111 case "GET", "HEAD", "DELETE", "OPTIONS", "PROPFIND", "SEARCH":
112 return true
113 }
114 return false
115}
116
117// requiresHTTP1 reports whether this request requires being sent on
118// an HTTP/1 connection.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…