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

Method String

response.go:228–230  ·  view source on GitHub ↗

String returns the response body as string that have already been read, could be nil if not read, the following cases are already read: 1. `Request.SetResult` or `Request.SetError` is called. 2. `Client.DisableAutoReadResponse` and `Request.DisableAutoReadResponse` is not called, and also `Request.S

()

Source from the content-addressed store, hash-verified

226// 2. `Client.DisableAutoReadResponse` and `Request.DisableAutoReadResponse` is not
227// called, and also `Request.SetOutput` and `Request.SetOutputFile` is not called.
228func (r *Response) String() string {
229 return string(r.body)
230}
231
232// ToString returns the response body as string, read body if not have been read.
233func (r *Response) ToString() (string, error) {

Callers 1

DumpMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected