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

Function outgoingLength

http_request.go:70–78  ·  view source on GitHub ↗

outgoingLength reports the Content-Length of this outgoing (Client) request. It maps 0 into -1 (unknown) when the Body is non-nil.

(r *http.Request)

Source from the content-addressed store, hash-verified

68// outgoingLength reports the Content-Length of this outgoing (Client) request.
69// It maps 0 into -1 (unknown) when the Body is non-nil.
70func outgoingLength(r *http.Request) int64 {
71 if r.Body == nil || r.Body == NoBody {
72 return 0
73 }
74 if r.ContentLength != 0 {
75 return r.ContentLength
76 }
77 return -1
78}
79
80// errMissingHost is returned by Write when there is no Host or URL present in
81// the Request.

Callers 2

shouldRetryRequestMethod · 0.85
newTransferWriterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…