internal override Response GetBalance() { try { new Validation(Url, User, Password, Token).ValidateHeaderParameters(); this.SetupRequest(); var request = (HttpWebRequest)WebRequest.Create(this.Url + "account/balance"); request.ContentType = "application/json"; request.Method = WebRequestMethods.Http.Get; request.Headers.Add(HttpRequestHeader.Authorization.ToString(), "bearer " + this.Token); Helpers.RequestHelper.SetupProxy(this.Proxy, this.ProxyPort, ref request); request.ContentLength = 0; return(_handler.GetResponse(request)); } catch (Exception e) { return(_handler.HandleException(e)); } }
internal async override Task <Response> GetBalance() { try { new Validation(Url, User, Password, Token).ValidateHeaderParameters(); await this.SetupRequestAsync(); Dictionary <string, string> headers = new Dictionary <string, string>() { { "Authorization", "bearer " + this.Token } }; var proxy = Helpers.RequestHelper.ProxySettings(this.Proxy, this.ProxyPort); return(await _handler.GetResponseAsync(this.Url, headers, "account/balance", proxy)); } catch (Exception e) { return(_handler.HandleException(e)); } }
internal override Response GetBalance() { try { new Validation(Url, User, Password, Token).ValidateHeaderParameters(); SetupRequest(); Dictionary <string, string> headers = new Dictionary <string, string> { { "Authorization", "bearer " + Token } }; var proxy = RequestHelper.ProxySettings(Proxy, ProxyPort); return(_handler.GetResponse(Url, headers, "account/balance", proxy)); } catch (Exception e) { return(_handler.HandleException(e)); } }