Spring Boot - Request and Response Handling
Why does this Spring Boot method fail content negotiation?
@GetMapping(value = "/user", produces = "application/json")
public User getUser(@RequestHeader("Accept") String accept) {
if (!accept.equals("application/json")) {
throw new RuntimeException("Unsupported format");
}
return new User("Alice");
}