/// <summary> /// Ran by the thread to perform the request. /// </summary> public void Run() { if (this.param.Count > 0) { BotUtil.POSTPage(new Uri(this.url), this.param); } else { BotUtil.LoadPage(new Uri(url)); } }
/// <summary> /// Perform a GET request. /// </summary> /// <param name="async">True if this request should be asynchronous.</param> /// <param name="url">The URL.</param> public void PerformURLGET(bool async, String url) { try { if (async) { AsynchronousCloudRequest request = new AsynchronousCloudRequest(url); Thread t = new Thread(new ThreadStart(request.Run)); t.Start(); } else { String contents = BotUtil.LoadPage(new Uri(url)); HandleResponse(contents); } } catch (IOException e) { throw new EncogCloudError(e); } }
/// <summary> /// Get a published text file. /// </summary> /// <param name="publishedPath">The path.</param> /// <returns>The file.</returns> public String GetPublishedTextFile(String publishedPath) { String uri = this.server + "published" + publishedPath; return(BotUtil.LoadPage(new Uri(uri))); }