AdvancedLauncher.Tools.WebClientEx.DownloadContent C# (CSharp) Method

DownloadContent() public static method

public static DownloadContent ( ILogManager logManager, string url, int timeOut = null ) : string
logManager ILogManager
url string
timeOut int
return string
        public static string DownloadContent(ILogManager logManager, string url, int? timeOut = null)
        {
            return DownloadContent(logManager, url, 100, timeOut);
        }

Same methods

WebClientEx::DownloadContent ( ILogManager logManager, string url, int tryAttempts, int timeOut ) : string
WebClientEx::DownloadContent ( string url, int timeOut = null ) : string
WebClientEx::DownloadContent ( string url, int tryAttempts, int timeOut ) : string

Usage Example

        public string InvokeAPI(string action, Dictionary <string, string> parameters)
        {
            var url = string.Format(API + "&{1}", action,
                                    string.Join("&",
                                                parameters.Select(kvp =>
                                                                  string.Format("{0}={1}", HttpUtility.UrlEncode(kvp.Key), HttpUtility.UrlEncode(kvp.Value)))));

            return(WebClientEx.DownloadContent(url, 1, 1500));
        }