title: REST service call
body: <p>I have to call method using REST service as I got some solution from material but getting error in <code>await</code></p>
  
  <pre><code>public static Task RunAsync()
  {
      string pathValue = WebConfigurationManager.AppSettings["R2G2APIUrl"];
      using (var client = new HttpClient())
      {
          client.BaseAddress = new Uri(pathValue);
          client.DefaultRequestHeaders.Accept.Clear();
          client.DefaultRequestHeaders.Accept.Add(
                      new MediaTypeWithQualityHeaderValue("application/json"));
  
          var id = "12421";
          HttpResponseMessage response = await client.GetAsync("api/products/1");
          var jobid = new Jobs() { Job_ID = id};
          response = await client.PostAsJsonAsync("api/products", jobid);
          if (response.IsSuccessStatusCode)
          {
              Uri gizmoUrl = response.Headers.Location;
          }
      }
  }
  static void Main()
  {
      RunAsync().Wait();
  }
  </code></pre>
  
  <p>await is not exist in current context as I am using vs2010 but is there any other solution for this?</p>