spring - POSTMAN gives following Error "The server refused this request because the request entity is in a format not supported by the requested resource" -
i know meaning of error can't debug it.
my bean class is :
public class user { private string name; private int age; public string getname() { return name; } public void setname(string name) { this.name = name; } public int getage() { return age; } public void setage(int age) { this.age = age; } }
my controller is:
@requestmapping(value = "/user/create", method = requestmethod.post) public responseentity<void> createuser(@requestbody user user, uricomponentsbuilder ucbuilder) { system.out.println("creating user " + user.getname()); httpheaders headers = new httpheaders(); headers.setlocation(ucbuilder.path("/user/{id}").buildandexpand(user.getname()).touri()); return new responseentity<void>(headers, httpstatus.created); }
Comments
Post a Comment