// ReadJSON is one of the lower-level methods of the client to read the result of a `Client#Do`, it closes the body stream.
//
// See `ReadResponseBody` lower-level of method to read a response for more details.
ReadJSON is one of the lower-level methods of the client to read the result of a `Client#Do`, it closes the body stream.

See `ReadResponseBody` lower-level of method to read a response for more details.
// ReadJSON is one of the lower - level methods of the client to read the result of a ` Client#Do ` it closes the body stream . // // See ` ReadResponseBody ` lower - level of method to read a response for more details .
func (c *Client) ReadJSON(resp *http.Response, valuePtr interface{}) error {
	b, err := c.ReadResponseBody(resp)
	if err != nil {
		return err
	}
	err = json.Unmarshal(b, valuePtr)
	if c.Config.Debug {
		if syntaxErr, ok := err.(*json.SyntaxError); ok {
			golog.Errorf("Client#ReadJSON: syntax error at offset [%d]: [%s]", syntaxErr.Offset, syntaxErr.Error())
		}
	}
	return err
}
func ( c * Client ) ReadJSON ( resp * http . Response , valuePtr interface { } ) error { b , err := c . ReadResponseBody ( resp ) if err != nil { return err } err = json . Unmarshal ( b , valuePtr ) if c . Config . Debug { if syntaxErr , ok := err . ( * json . SyntaxError ) ; ok { golog . Errorf ( " " , syntaxErr . Offset , syntaxErr . Error ( ) ) } } return err }
ReadJSON is one of the lower-level methods of the client to read the result of a `Client#Do`, it closes the body stream.
ReadJSON is one of the lower - level methods of the client to read the result of a ` Client#Do ` it closes the body stream .