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

Method ToString

response.go:233–236  ·  view source on GitHub ↗

ToString returns the response body as string, read body if not have been read.

()

Source from the content-addressed store, hash-verified

231
232// ToString returns the response body as string, read body if not have been read.
233func (r *Response) ToString() (string, error) {
234 b, err := r.ToBytes()
235 return string(b), err
236}
237
238// ToBytes returns the response body as []byte, read body if not have been read.
239func (r *Response) ToBytes() (body []byte, err error) {

Callers 2

Calls 1

ToBytesMethod · 0.95

Tested by 2