func (v *Redcat) RequestLocations() (string, error) {
	urlStr := v.BaseURL + locationURL

	fmt.Println("Connecting to redcat", urlStr)

	client := &http.Client{}

	r, err := http.NewRequest("POST", urlStr, nil)
	if err != nil {
		return "", err
	}

	r.Header = http.Header(make(map[string][]string))
	r.Header.Set(authHeader, v.accessToken)
	r.Header.Set("Content-Type", "application/json")

	res, err := client.Do(r)
	if err != nil {
		return "", err
	}

	if res.StatusCode == 200 {

		rawResBody, err := ioutil.ReadAll(res.Body)
		if err != nil {
			return "", err
		}
		return string(rawResBody), nil

		/*var resp ReportResult

		err = json.Unmarshal(rawResBody, &resp)

		if err != nil {
			return nil, err
		}
		return &resp, nil*/
	}

	return "", fmt.Errorf("Failed to get Redcat Sales Report %s", res.Status)
}
// RequestLocations will request a report from Redcat
RequestLocations will request a report from Redcat
// RequestLocations will request a report from Redcat
func (v *Redcat) RequestLocations() (string, error) {
	urlStr := v.BaseURL + locationURL
	fmt.Println("Connecting to redcat", urlStr)
	client := &http.Client{}
	r, err := http.NewRequest("POST", urlStr, nil)
	if err != nil {
		return "", err
	}
	r.Header = http.Header(make(map[string][]string))
	r.Header.Set(authHeader, v.accessToken)
	r.Header.Set("Content-Type", "application/json")
	res, err := client.Do(r)
	if err != nil {
		return "", err
	}
	if res.StatusCode == 200 {
		rawResBody, err := ioutil.ReadAll(res.Body)
		if err != nil {
			return "", err
		}
		return string(rawResBody), nil
	}
	return "", fmt.Errorf("Failed to get Redcat Sales Report %s", res.Status)
}
func ( v * Redcat ) RequestLocations ( ) ( string , error ) { urlStr := v . BaseURL + locationURL fmt . Println ( " " , urlStr ) client := & http . Client { } r , err := http . NewRequest ( " " , urlStr , nil ) if err != nil { return " " , err } r . Header = http . Header ( make ( map [ string ] [ ] string ) ) r . Header . Set ( authHeader , v . accessToken ) r . Header . Set ( " " , " " ) res , err := client . Do ( r ) if err != nil { return " " , err } if res . StatusCode == 200 { rawResBody , err := ioutil . ReadAll ( res . Body ) if err != nil { return " " , err } return string ( rawResBody ) , nil } return " " , fmt . Errorf ( " " , res . Status ) }
RequestLocations will request a report from Redcat
RequestLocations will request a report from Redcat
/*var resp ReportResult

		err = json.Unmarshal(rawResBody, &resp)

		if err != nil {
			return nil, err
		}
		return &resp, nil*/