// RequestJSON will make a request to a given path, with a given body and
// return the JSON bytes result into `out` to unmarshal.
RequestJSON will make a request to a given path, with a given body and
return the JSON bytes result into `out` to unmarshal.
// RequestJSON will make a request to a given path with a given body and // return the JSON bytes result into ` out ` to unmarshal .
func (c *Client) RequestJSON(path, method string, body MarshalableJSON, out UnmarshalableJSON) error {
	var bytes []byte
	if body != nil {
		raw, err := body.MarshalJSON()
		if err != nil {
			return err
		}
		bytes = raw
	}
	resBody, err := c.Request(path, method, bytes)
	if err != nil {
		return err
	}
	if out == nil {
		return nil
	}
	return out.UnmarshalJSON(resBody)
}
func ( c * Client ) RequestJSON ( path , method string , body MarshalableJSON , out UnmarshalableJSON ) error { var bytes [ ] byte if body != nil { raw , err := body . MarshalJSON ( ) if err != nil { return err } bytes = raw } resBody , err := c . Request ( path , method , bytes ) if err != nil { return err } if out == nil { return nil } return out . UnmarshalJSON ( resBody ) }
RequestJSON will make a request to a given path, with a given body and
return the JSON bytes result into `out` to unmarshal.
RequestJSON will make a request to a given path with a given body and return the JSON bytes result into ` out ` to unmarshal .