TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Harish Batchu
NA
255
70.3k
I am getting null value when request hitting to controller?
May 23 2019 8:06 AM
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("api/Order/{StatusId}/Status/{OrderId}/Order")]
[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
Reply
Answers (
3
)
private const string ConfigurationFilePath = "config.json";
Resharper short cuts are not working in Visual studio 2017