I am developing Web API in dot net core 2.1. When i am passing the values through postman the request hitting to controller but the value is not getting
Below is my code
- namespace MilkPos.API.Controllers
- {
- [Route("api/")]
- public class HomeController : ControllerBase
- {
- IUser _IUser;
- private DatabaseContxt _context;
- public HomeController(IUser user,DatabaseContxt context)
- {
- _IUser = user;
- _context = context;
- }
-
- [Route("GetOtp")]
- [HttpPost("{id}")]
- public ActionResult GetOtp(long id)
- {
- int otp = 0;
- return Ok(id);
- }
- [Route("GetGeneratedOtp")]
- [HttpPost]
- public ActionResult GetGeneratedOtp(int Number)
- {
- return Ok(Number);
- }
- }
- }
Form postman i am calling like:
http://localhost:8000/api/GetOtp/
Header
key content-type
value application/json
Body {"id":328432}
i am getting 0