📅  最后修改于: 2022-03-11 14:52:17.158000             🧑  作者: Mango
@GetMapping("/customHeader")
ResponseEntity customHeader() {
HttpHeaders headers = new HttpHeaders();
headers.add("Custom-Header", "foo");
return new ResponseEntity<>(
"Custom header set", headers, HttpStatus.OK);
}
//Simple way
@GetMapping("/hello")
ResponseEntity hello() {
return ResponseEntity.ok("Hello World!");
}