Removed non-needed variables.

This commit is contained in:
Adrian Gallagher
2015-03-07 18:54:03 +11:00
parent 6bb099aa00
commit f7264c716f
4 changed files with 4 additions and 10 deletions

View File

@@ -271,15 +271,13 @@ func (b *Bitstamp) SendAuthenticatedHTTPRequest(path string, values url.Values,
values.Set("nonce", nonce)
hmac := GetHMAC(sha256.New, []byte(nonce + b.ClientID + b.APIKey), []byte(b.APISecret))
values.Set("signature", strings.ToUpper(HexEncodeToString(hmac)))
reqBody := strings.NewReader(values.Encode())
path = BITSTAMP_API_URL + path
if b.Verbose {
log.Println("Sending POST request to " + path)
}
req, err := http.NewRequest("POST", path, reqBody)
req, err := http.NewRequest("POST", path, strings.NewReader(values.Encode()))
if err != nil {
return err
}

View File

@@ -186,9 +186,7 @@ func (b *BTCChina) SendAuthenticatedHTTPRequest(method string, params []string)
log.Printf("Sending POST request to %s calling method %s with params %s\n", "https://api.btcchina.com/api_trade_v1.php", method, data)
}
reqBody := strings.NewReader(string(data))
req, err := http.NewRequest("POST", "https://api.btcchina.com/api_trade_v1.php", reqBody)
req, err := http.NewRequest("POST", "https://api.btcchina.com/api_trade_v1.php", strings.NewReader(string(data)))
if err != nil {
return err

View File

@@ -179,8 +179,7 @@ func (b *BTCE) SendAuthenticatedHTTPRequest(method string, values url.Values) (e
log.Printf("Sending POST request to %s calling method %s with params %s\n", BTCE_API_URL, method, encoded)
}
reqBody := strings.NewReader(encoded)
req, err := http.NewRequest("POST", BTCE_API_URL, reqBody)
req, err := http.NewRequest("POST", BTCE_API_URL, strings.NewReader(encoded))
if err != nil {
return err

View File

@@ -205,8 +205,7 @@ func (h *HUOBI) SendAuthenticatedRequest(method string, v url.Values) (error) {
log.Printf("Sending POST request to %s with params %s\n", HUOBI_API_URL, encoded)
}
reqBody := strings.NewReader(encoded)
req, err := http.NewRequest("POST", HUOBI_API_URL, reqBody)
req, err := http.NewRequest("POST", HUOBI_API_URL, strings.NewReader(encoded))
if err != nil {
return err