title: Calling REST API in Asp.Net
body: <p>I want to call REST Api from Asp.net application in order to integrate with NCB bank, they provide me with some test parameters like:</p>
  
  <ol>
  <li>AccessCode</li>
  <li>Merchant Id</li>
  <li>Secure Hash code</li>
  </ol>
  
  <p>I've tried the below code but it doesn't work properly it throw 404 http error code.</p>
  
  <pre><code> private const string URL="https://migs.mastercard.com.au/vpcpay";
   private const string urlParameters = @"{""object"":{""vpc_AccessCode"":""000000"",""vpc_Version"":""0""};}";
  
   HttpClient client = new HttpClient();
   client.BaseAddress = new Uri(URL);
  
   //Add an Accept header for JSON format.
   client.DefaultRequestHeaders.Accept.Add(
   new MediaTypeWithQualityHeaderValue("application/json"));
  
   HttpResponseMessage response = client.GetAsync(urlParameters).Result;
  
  
     if (response.IsSuccessStatusCode)
      {
        // Parse the response body. Blocking!
        var dataObjects = response.Content.ReadAsAsync&lt;IEnumerable&lt;DataObject&gt;&gt;().Result;
           foreach (var d in dataObjects)
            {
              Console.WriteLine("{0}", d.Name);
            }
      }
     else
      {
        Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
      }
  </code></pre>