I'm trying to create an web service using spring rest4, but not able to pass input parameters through rest-client, can anybody suggest me how to pass input parameters.
RequestMapping(value = "/create", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody Status addEmployee(@RequestBody User user) {
try {
// Manually setting passing parameters
user.setUserId(0);
user.setFirstName("dfsdfsd");
user.setUserMailId("sadsda");
user.setAddress("sfds");
user.setCreatedBy(1);
user.setIsDeleted(0);
user.setLastName("sadas");
user.setMobileNumber("adsasdsa");
user.setUsrtStatus(1);
user.setUserPassword("asdsaf");
user.setRoleId(1);
System.out.println("firstname:=" + user);
dataServices.addEntity(user);
System.out.println(user);
return new Status(1, "Employee added Successfully !");
} catch (Exception e) {
e.printStackTrace();
return new Status(0, e.toString());
}
}
I'm using "WizTool.org RestClient 3.2.2", Url = "http://localhost:8080/XYZ2/rest/user/create" & input parameters i'm passing as -
{
"inputs": [{
"parameterName": "pv_user_id",
"parameterValue": ""
}{
"parameterName": "pv_adress",
"parameterValue": "kjhfgkjdfhgfdhk"
}]
}
thanks in advance


