title: How to send web request in queue in C# windows application
body: <p>I made an application to trigger web request from window application and forget,means without waiting response.</p>
  
  <pre><code>            string url1 = APIUrl + "/SendNotification";
              string url2 = Url + "/SendSOA";
  
              ASCIIEncoding encoding = new ASCIIEncoding();
              HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url1);
              request.Method = "Post";
              request.ContentLength = 0;
              request.ContentType = "application/json";
              request.GetResponseAsync(); //Mohan: Method will not wait for response just trigger and forget
  
              ASCIIEncoding encoding1 = new ASCIIEncoding();
              HttpWebRequest request1 = (HttpWebRequest)WebRequest.Create(url2);
              request1.Method = "Post";
              request1.ContentLength = 0;
              request1.ContentType = "application/json";
              request1.GetResponseAsync(); //Mohan: Method will not wait for response just trigger and forget
  </code></pre>
  
  <p>but when I am trying it by local host URL that time I see that these two methods are running means second request is not waiting for to complete first request so I want to send request in Queue then it will complete first Request and then will complete second request.</p>
  
  <p>means till one request is not completed second request should be in queue.
  once First request is completed then second request start in my web</p>
  
  <p>I tried it </p>
  
  <pre><code>            string APIUrl = ConfigurationManager.AppSettings["APIUrl"].ToString();
              string Url = ConfigurationManager.AppSettings["Url"].ToString();
  
              Queue httprequest = new Queue();
              string url1 = APIUrl + "/SendNotification";
              string url2 = Url + "/SendSOA";
  
              ASCIIEncoding encoding = new ASCIIEncoding();
              HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url1);
              request.Method = "Post";
              request.ContentLength = 0;
              request.ContentType = "application/json";
              httprequest.Enqueue(request);
              request.GetResponseAsync(); //Mohan: Method will not wait for response just trigger and forget
  
              ASCIIEncoding encoding1 = new ASCIIEncoding();
              HttpWebRequest request1 = (HttpWebRequest)WebRequest.Create(url2);
              request1.Method = "Post";
              request1.ContentLength = 0;
              request1.ContentType = "application/json";
              httprequest.Enqueue(request1);
              request1.GetResponseAsync(); //Mohan: Method will not wait for response just trigger and forget
  </code></pre>
  
  <p>but still its not waiting to complete first request.</p>
  
  <p>my web methods are</p>
  
  <pre><code>    [HttpPost]
      [AcceptVerbs("Post")]
      public async Task SendNotification()
      {
  
      }
  
      [HttpPost]
      [AcceptVerbs("Post")]
      public async Task SendSOA()
      {
  
      }
  </code></pre>
  
  <p>please help me to do it.</p>
  
  <p>Thanks in Advance.</p>