// do performs the request and handles easycron error.
do performs the request and handles easycron error.
// do performs the request and handles easycron error .
func (c *Client) do(req *http.Request) ([]byte, int64, error) {
	res, err := c.HTTPClient.Do(req)
	if err != nil {
		return nil, 0, err
	}
	body, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return nil, 0, err
	}
	defer res.Body.Close()
	e := &Error{}
	if err := json.Unmarshal(body, e); err != nil {
		return nil, 0, err
	}
	if e.Status == "error" {
		return nil, 0, e
	}
	return body, res.ContentLength, nil
}
func ( c * Client ) do ( req * http . Request ) ( [ ] byte , int64 , error ) { res , err := c . HTTPClient . Do ( req ) if err != nil { return nil , 0 , err } body , err := ioutil . ReadAll ( res . Body ) if err != nil { return nil , 0 , err } defer res . Body . Close ( ) e := & Error { } if err := json . Unmarshal ( body , e ) ; err != nil { return nil , 0 , err } if e . Status == " " { return nil , 0 , e } return body , res . ContentLength , nil }
do performs the request and handles easycron error.
do performs the request and handles easycron error .