// GetJSON performs a get call on specific url and fills the object structure.
GetJSON performs a get call on specific url and fills the object structure.
// GetJSON performs a get call on specific url and fills the object structure .
func GetJSON(url string, object interface{}) error {
	resp, err := httpClient.Get(fmt.Sprintf("%v%v", rootURL, url))
	if err != nil {
		return err
	}
	switch resp.StatusCode {
	case 404:
		return fmt.Errorf("Ressource for URL %v not found.", url)
	}
	defer resp.Body.Close()
	return json.NewDecoder(resp.Body).Decode(object)
}
func GetJSON ( url string , object interface { } ) error { resp , err := httpClient . Get ( fmt . Sprintf ( " " , rootURL , url ) ) if err != nil { return err } switch resp . StatusCode { case 404 : return fmt . Errorf ( " " , url ) } defer resp . Body . Close ( ) return json . NewDecoder ( resp . Body ) . Decode ( object ) }
GetJSON performs a get call on specific url and fills the object structure.
GetJSON performs a get call on specific url and fills the object structure .