MCPcopy
hub / github.com/gofiber/fiber / BodyStream

Method BodyStream

client/response.go:95–101  ·  view source on GitHub ↗

BodyStream returns the response body as a stream reader. Note: When using BodyStream(), the response body is not copied to memory, so calling Body() afterwards may return an empty slice.

()

Source from the content-addressed store, hash-verified

93// Note: When using BodyStream(), the response body is not copied to memory,
94// so calling Body() afterwards may return an empty slice.
95func (r *Response) BodyStream() io.Reader {
96 if stream := r.RawResponse.BodyStream(); stream != nil {
97 return stream
98 }
99 // If streaming is not enabled, return a bytes.Reader from the regular body
100 return bytes.NewReader(r.RawResponse.Body())
101}
102
103// IsStreaming returns true if the response body is being streamed.
104func (r *Response) IsStreaming() bool {

Callers 7

SaveMethod · 0.95
Test_Response_BodyStreamFunction · 0.80
execFuncMethod · 0.80
IsStreamingMethod · 0.80
handlerFuncFunction · 0.80

Calls 1

BodyMethod · 0.65

Tested by 3

Test_Response_BodyStreamFunction · 0.64