i have restful webservice project. In which i have written method with post type. I am trying to access that method via URL "localhost:8091/prjctname/post". But its throwing "HTTP Status 405 - Request method 'GET' not supported type Status report message Request method 'GET' not supported description The specified HTTP method is not allowed for the requested resource." error.
Below is the code snippet.
@RequestMapping(value = "/post", method = RequestMethod.POST)
@Produces("application/json")
@ResponseBody
public String createUser(@RequestBody PCDBean bean,HttpServletRequest request)
{
String username = null;
String password = null;
System.out.println("inside post method");
String result = service.getCustomer(username, password);
if(result!=null)
{
return username + password;
}
else
{
return "failure";
}
}
Please help me. I am stuck in this since so long
Aucun commentaire:
Enregistrer un commentaire