title: How to pass an object of type as a parameter to Web Api Get/Post method
body: <p>Here is my Post method and i am passing an object which contains parameters  </p>
  
  <pre><code>public class TransactionController : ApiController
  {
   [HttpPost]
      public TransactionResponse mytest2(TransactionOperationInput input)
      {
         // some operation here 
      }
  }
  </code></pre>
  
  <p>Here is the URL i am trying to test  </p>
  
  <pre><code>http://localhost:33755/api/Transaction/mytest2?SourceKey=abcdef&amp;Pin=123&amp;Criteria=2018-09-12 00:00:00
  </code></pre>
  
  <p><strong>Outcome When method is set to POST and Get</strong></p>
  
  <p>[HttpPost] : I get an error 405 method not allowed.</p>
  
  <p>[HttpGet] : input parameter is NULL</p>
  
  <p>This is the Register Route class; ( sorry i am new to Route tables)</p>
  
  <pre><code>public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapRoute(
              name: "Default",
              url: "{controller}/{action}/{id}",
              defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
          );
      }
  </code></pre>
  
  <p>Do i need to update route table? or Is my URL wrong?</p>
  
  <p>Also, should i have the service method as Post or Get?</p>