public static CometCommand ParseFromRequest(HttpLib.HttpRequest request) { if (request == null || request.PathUri.Segments.Length < 2) return new CometCommand(); string command = request.PathUri.Segments[1]; return ParseFromString(command); }
static Dictionary <string, string> GetPricesBatch() { HttpLib restLib = new HttpLib(); restLib.AddHeader("User-Agent", "GDAXBotter"); Task <IEnumerable <string> > prices = restLib.GetStringsBatch(URL_FOR("ETH"), URL_FOR("BTC"), URL_FOR("LTC")); prices.Wait(); string[] priceArray = prices.Result.ToArray(); Dictionary <string, string> result = new Dictionary <string, string>(); result["ETH"] = priceArray[0]; result["BTC"] = priceArray[1]; result["LTC"] = priceArray[2]; return(result); }
public async Task Run() { var f = Ping(); if (!f) { return; } var t = await HttpLib.Get(Constants.BaseUrl); if (string.IsNullOrEmpty(t)) { return; } await ParseFilm(t); }
static Dictionary <string, string> GetPrices() { HttpLib restLib = new HttpLib(); restLib.AddHeader("User-Agent", "GDAXBotter"); Task <string> ethPricePromise = restLib.GetString(URL_FOR("ETH")); Task <string> ltcPricePromise = restLib.GetString(URL_FOR("LTC")); Task <string> btcPricePromise = restLib.GetString(URL_FOR("BTC")); ethPricePromise.Wait(); ltcPricePromise.Wait(); btcPricePromise.Wait(); Dictionary <string, string> result = new Dictionary <string, string>(); result["ETH"] = ethPricePromise.Result; result["BTC"] = btcPricePromise.Result; result["LTC"] = ltcPricePromise.Result; return(result); }
public virtual void HandleRequest(ClientManager clmngr, HttpLib.HttpContext context) { }
/// <summary>Get current URL query parameters and it's values.</summary> /// <param name="webDriver">Target WebDriver</param> /// <returns>Collection of URL parameters names as keys and parameters values as values</returns> public static NameValueCollection GetUrlParameters(this IWebDriver webDriver) { return(HttpLib.ParseQueryString(new Uri(webDriver.Url).Query)); }
public NameValueCollection ShouldParseUrlQueryString(string queryString) { return(HttpLib.ParseQueryString(queryString)); }