Look at the handler method's definition and choose the request that can be handled by it:
@PostMapping(value = "/employees", consumes = "application/json")
public String greet(@RequestBody List<Employee> employees)
Requests:
1
GET http://localhost:8080/employees
Content-Type: application/json
Cache-Control: no-cache
[
{
"id" : "290",
"firstName" : "Andrew",
"lastName" : "Scott",
"phone" : "570827"
},
{
"id" : "832",
"firstName" : "Sally",
"lastName" : "Johnson",
"phone" : "293818"
}
]
2
POST http://localhost:8080/employees
Content-Type: application/json
Cache-Control: no-cache
{
"id" : "290",
"firstName" : "Andrew",
"lastName" : "Scott",
"phone" : "570827"
}
3
POST http://localhost:8080/employees
Content-Type: application/xml
Cache-Control: no-cache
{
"id" : "290",
"firstName" : "Andrew",
"lastName" : "Scott",
"phone" : "570827"
}
4
POST http://localhost:8080/employees
Content-Type: application/json
Cache-Control: no-cache
[
{
"id" : "290",
"firstName" : "Andrew",
"lastName" : "Scott",
"phone" : "570827"
},
{
"id" : "832",
"firstName" : "Sally",
"lastName" : "Johnson",
"phone" : "293818"
}
]