mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-04 15:10:54 +00:00
Add httputil.DumpRequestOut & httputil.DumpResponse to SendPayload (#298)
* First pass adding DumpResponse * WIP * Added httpDebug flag to SendPayload * anx -> coinbase converted * HTTPDebug flag added to all exchanges * Updated Alphapoint: * reworded error message * Corrected itbit and huobihadax sendpayload * Removed setting of default value * don't return body for response as we already get this in verbose mode * body is now included based on verbose setting * WIP * Due to issues with DumpResponse and gzip decoding use raw response from exchange for body output Also adds gzip decoding back as bug fix for OK group exchange * removed additional new line * Added URL path to dumpbody display as well
This commit is contained in:
@@ -94,6 +94,7 @@ func (z *ZB) Setup(exch *config.ExchangeConfig) {
|
||||
z.SetHTTPClientUserAgent(exch.HTTPUserAgent)
|
||||
z.RESTPollingDelay = exch.RESTPollingDelay
|
||||
z.Verbose = exch.Verbose
|
||||
z.HTTPDebugging = exch.HTTPDebugging
|
||||
z.Websocket.SetWsStatusAndConnection(exch.Websocket)
|
||||
z.BaseCurrencies = exch.BaseCurrencies
|
||||
z.AvailablePairs = exch.AvailablePairs
|
||||
@@ -361,7 +362,7 @@ func (z *ZB) GetCryptoAddress(currency currency.Code) (UserAddress, error) {
|
||||
|
||||
// SendHTTPRequest sends an unauthenticated HTTP request
|
||||
func (z *ZB) SendHTTPRequest(path string, result interface{}) error {
|
||||
return z.SendPayload(http.MethodGet, path, nil, nil, result, false, false, z.Verbose)
|
||||
return z.SendPayload(http.MethodGet, path, nil, nil, result, false, false, z.Verbose, z.HTTPDebugging)
|
||||
}
|
||||
|
||||
// SendAuthenticatedHTTPRequest sends authenticated requests to the zb API
|
||||
@@ -398,7 +399,8 @@ func (z *ZB) SendAuthenticatedHTTPRequest(httpMethod string, params url.Values,
|
||||
&intermediary,
|
||||
true,
|
||||
false,
|
||||
z.Verbose)
|
||||
z.Verbose,
|
||||
z.HTTPDebugging)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user