title: All methods act as a HTTP verb (Get, Put, Post And Delete) in ASP.NET WEB API controller
body: <p>I am building up a <strong>ASP.NET Core 2.0 WEB API</strong>. My controller has several methods. But, all the methods are not working when I am calling from Postman. All the time it behaves like HTTP (Get, Put, Post And Delete) verbs. So, how can I call my desired methods from client side. Or, is it okay to serve this way?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>namespace DutchTreat.Controllers
  {
      [Route("api/[controller]")]
      public class OrdersController : Controller
      {
          private readonly IDutchRepository _ctx;
          private readonly ILogger&lt;OrdersController&gt; _logger;
  
          public OrdersController(IDutchRepository _ctx, ILogger&lt;OrdersController&gt; logger)
          {
              this._ctx = _ctx;
              _logger = logger;
          }
  
          [HttpGet]
          public IActionResult Get()
          {
              try
              {
                  return Ok(_ctx.GeAllOrders());
              }
              catch (Exception e)
              {
                  return BadRequest("Something Went Wrong");
              }
          }
  
          [HttpGet("{id:int}")]
          public IActionResult GetOrdersById(int id)
          {
              try
              {
                  var orders = _ctx.GetOrdersById(id);
  
                  if (orders != null)
                      return Ok(orders);
                  else
                      return NotFound();
              }
              catch (Exception e)
              {
                  return BadRequest("Something Went Wrong");
              }
          }
  
          [HttpPost]
          public IActionResult Post(Order model)
          {
              try
              {
                 _ctx.AddEntity(model);
                  _ctx.SaveChanges();
  
                  return Created($"/api/orders/{model.Id}", model);
              }
              catch (Exception e)
              {
                  return BadRequest("Something Went Wrong");
              }
          }
  
          public IActionResult SampleMethod()
          {
              // Sample Method Definition
  
              return null;
          }
      }
  }
  </code></pre>
  
  <p>And I am requesting from Postman: <a href="http://localhost:8888/api/orders/SampleMethod" rel="nofollow noreferrer">http://localhost:8888/api/orders/SampleMethod</a>
  It shows <strong>404 not found</strong>!</p>