Esempio n. 1
0
        private string CallStringWS(string relativeURL, RequestComplexity pComplexity)
        {
            var requestUrl = _CurrentConnection.EndsWith("/") ? _CurrentConnection.Substring(0, _CurrentConnection.Length - 1) : _CurrentConnection;

            requestUrl += "/";
            requestUrl += relativeURL.StartsWith("/") ? relativeURL.Substring(1) : relativeURL;

            try
            {
                return(_Client.DownloadPlainText(requestUrl, pComplexity));
            }
            catch (WebException e)
            {
                LogHelper.Instance.LogError(e.Message);
                return(null);
            }
        }
Esempio n. 2
0
        private string CallStringWS(string relativeURL, RequestComplexity pComplexity)
        {
            var requestUrl = _CurrentConnection.EndsWith("/") ? _CurrentConnection.Substring(0, _CurrentConnection.Length - 1) : _CurrentConnection;

            requestUrl += "/";
            requestUrl += relativeURL.StartsWith("/") ? relativeURL.Substring(1) : relativeURL;

            try
            {
                if (_Client.GetCookieContainer().Count > 0)
                {
                    _Client.RemoveAuthenticationHeaders(CurrentApiKey);
                }
                return(_Client.DownloadPlainText(requestUrl, pComplexity));
            }
            catch (WebException e)
            {
                LogHelper.Instance.LogError(e.Message);
                return(null);
            }
        }