An asynchronous cloud request is set to the cloud, but we do not require a reply. This allows status updates to be executed in a separate therad without the need to wait.
Example #1
0
 /// <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);
     }
 }
Example #2
0
 /// <summary>
 /// Perform a POST to the cloud.
 /// </summary>
 /// <param name="async">True if this request should be asynchronous.</param>
 /// <param name="service">The service.</param>
 /// <param name="args">The POST arguments.</param>
 public void PerformURLPOST(bool async, String service,
                            IDictionary <String, String> args)
 {
     try
     {
         if (async)
         {
             AsynchronousCloudRequest request = new AsynchronousCloudRequest(
                 service, args);
             Thread t = new Thread(new ThreadStart(request.Run));
             t.Start();
         }
         else
         {
             String contents = BotUtil.POSTPage(new Uri(service), args);
             HandleResponse(contents);
         }
     }
     catch (IOException e)
     {
         throw new EncogCloudError(e);
     }
 }
 /// <summary>
 /// Perform a POST to the cloud. 
 /// </summary>
 /// <param name="async">True if this request should be asynchronous.</param>
 /// <param name="service">The service.</param>
 /// <param name="args">The POST arguments.</param>
 public void PerformURLPOST(bool async, String service,
         IDictionary<String, String> args)
 {
     try
     {
         if (async)
         {
             AsynchronousCloudRequest request = new AsynchronousCloudRequest(
                     service, args);
             Thread t = new Thread(new ThreadStart(request.Run));
             t.Start();
         }
         else
         {
             String contents = BotUtil.POSTPage(new Uri(service), args);
             HandleResponse(contents);
         }
     }
     catch (IOException e)
     {
         throw new EncogCloudError(e);
     }
 }
 /// <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);
     }
 }