func (plug *PlugDJ) Post(endpoint string, data map[string]string) (*http.Response, error) {
	body, err := json.Marshal(data)
	if err != nil {
		return nil, err
	}

	resp, err := plug.web.Post(plug.getAPIURL()+endpoint, "application/json", bytes.NewReader(body))
	if err != nil {
		return nil, err
	}

	// If the status code is not 200, error away
	if resp.StatusCode != 200 {
		resp.Body.Close()
		return nil, ErrUnknownResponse{resp, endpoint}
	}

	return resp, nil
}
// Post makes a post request with the map provided as json to the plug API
Post makes a post request with the map provided as json to the plug API
// Post makes a post request with the map provided as json to the plug API
func (plug *PlugDJ) Post(endpoint string, data map[string]string) (*http.Response, error) {
	body, err := json.Marshal(data)
	if err != nil {
		return nil, err
	}
	resp, err := plug.web.Post(plug.getAPIURL()+endpoint, "application/json", bytes.NewReader(body))
	if err != nil {
		return nil, err
	}
	if resp.StatusCode != 200 {
		resp.Body.Close()
		return nil, ErrUnknownResponse{resp, endpoint}
	}
	return resp, nil
}
func ( plug * PlugDJ ) Post ( endpoint string , data map [ string ] string ) ( * http . Response , error ) { body , err := json . Marshal ( data ) if err != nil { return nil , err } resp , err := plug . web . Post ( plug . getAPIURL ( ) + endpoint , " " , bytes . NewReader ( body ) ) if err != nil { return nil , err } if resp . StatusCode != 200 { resp . Body . Close ( ) return nil , ErrUnknownResponse { resp , endpoint } } return resp , nil }
Post makes a post request with the map provided as json to the plug API
Post makes a post request with the map provided as json to the plug API
// If the status code is not 200, error away