title: Post request going to Get function in WEB API in ASP.NET MVC 4
body: <p>I have created a controller in the ASP.NET Web API. Below is the code for the controller</p>
  
  <pre><code>public class CalculateController : ApiController
  {
      public IEnumerable&lt;string&gt; Get()
      {
  
          return new string[] { "from get method" };
  
      }
  
      public IEnumerable&lt;string&gt; Post([FromBody]string value)
      {
  
          return new string[] { "from post method" };
      }
  }
  </code></pre>
  
  <p>Below is the code that I am using to make a post request to the webAPI</p>
  
  <pre><code>HttpWebRequest httpWReq = (HttpWebRequest)WebRequest.Create("http://localhost:62479/api/calculate");
  
          StringBuilder postdata = new StringBuilder("value=Anshuman");
          byte[] data = Encoding.UTF8.GetBytes(postdata.ToString());
          httpWReq.Method = "POST";
          httpWReq.ContentType = "application/x-www-form-urlencoded";
          httpWReq.ContentLength = data.Length;
  
          using (Stream stream = httpWReq.GetRequestStream())
          {
              stream.Write(data, 0, data.Length);
          }
          HttpWebResponse response = (HttpWebResponse)httpWReq.GetResponse();
          string responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
  </code></pre>
  
  <p>The problem is that even if I make a <strong>POST</strong> request even then the data is returned from the <strong>GET</strong> method of the Controller. I have not made any changes in the default configuration of the Web API project. I am using MVC 4. </p>
  
  <p>Thanks for your time. If any other information is required then please add a comment.</p>
  
  <p>I have both the projects running in Visual Studio 2012 on the same machine.</p>