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

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -