0
I have MVC architecture project.now i want to give api to android developer .so how can i test the POST API services through POSTMAN.when i send post service through postman it will return null value..
What I have tried:
<pre>url:-http:
JSON DATA:- { "EmpFName":"Sa", "EmpMName":"s", "EmpLName":"SS", "AadhaarCardNumber":null, "PanCardNumber":null, "DateOfBirth":"1993-10-20T00:00:00", "Address":"Pune", "City":"Pune", "State":"Maharashtra", "Country":"India", "PinCode":"410505", "EmailID":"sa@GMAIL.COM", "Password":"123456", "PhotoPath":null, "MobileNo":"74487855545", "EmergancyContactNo":"7447774558", "MaritalStatus":"single", "Designation":"devlop", "ReportingMgr":1, "LeaveCount":18, "SpouseName":null, "SpDOB":null, "SpAge":null, "FirstChildName":null, "FCDOB":null, "FCAge":null, "SecondChidName":null, "SCDOB":null, "SCAge":null, "IsActive":true, "CreatedBy":null, "UpdatedOn":null, "Gender":"Female", "SCGender":"Male", "SpGender":"Female", "FCGender":"female"
}
cODE:-
[HttpPost] [Route("addemmployee")] public ActionResult AddEmployee( FormCollection form) {
try
{
Employee emp = new Employee();
emp.JoiningDate = Convert.ToDateTime(form["joining_date"]);
emp.EmpFName = form["txt_fname"];
emp.EmpMName = form["txt_mname"];
emp.EmpLName = form["txt_lname"];
emp.AadhaarCardNumber = form["aadhaarnum"];
MasterReposities.SaveEmployee(emp);