func (c *Client) NewRequest(path, method string, body interface{}) (*http.Response, error) {
	switch method {
	case "post":
		b, err := encodeBody(body)
		if err != nil {
			return nil, err
		}
		resp, err := http.Post(c.config.Address+path, "application/json; charset=utf-8", b)
		if err != nil {
			return nil, err
		}
		return resp, nil
	case "get":
		resp, err := http.Get(c.config.Address + path)
		if err != nil {
			return nil, err
		}
		return resp, nil
	default:
		return nil, errors.New("invalid method type " + method)
	}

}
// NewRequest sends a request with the desired parameters to the server
NewRequest sends a request with the desired parameters to the server
// NewRequest sends a request with the desired parameters to the server
func (c *Client) NewRequest(path, method string, body interface{}) (*http.Response, error) {
	switch method {
	case "post":
		b, err := encodeBody(body)
		if err != nil {
			return nil, err
		}
		resp, err := http.Post(c.config.Address+path, "application/json; charset=utf-8", b)
		if err != nil {
			return nil, err
		}
		return resp, nil
	case "get":
		resp, err := http.Get(c.config.Address + path)
		if err != nil {
			return nil, err
		}
		return resp, nil
	default:
		return nil, errors.New("invalid method type " + method)
	}
}
func ( c * Client ) NewRequest ( path , method string , body interface { } ) ( * http . Response , error ) { switch method { case " " : b , err := encodeBody ( body ) if err != nil { return nil , err } resp , err := http . Post ( c . config . Address + path , " " , b ) if err != nil { return nil , err } return resp , nil case " " : resp , err := http . Get ( c . config . Address + path ) if err != nil { return nil , err } return resp , nil default : return nil , errors . New ( " " + method ) } }
NewRequest sends a request with the desired parameters to the server
NewRequest sends a request with the desired parameters to the server