📜  响应实体作为结果弹簧控制器 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:22.198000             🧑  作者: Mango

代码示例1
@RequestMapping("/handle")
 public ResponseEntity handle() {
   URI location = ...;
   HttpHeaders responseHeaders = new HttpHeaders();
   responseHeaders.setLocation(location);
   responseHeaders.set("MyResponseHeader", "MyValue");
   return new ResponseEntity("Hello World", responseHeaders, HttpStatus.CREATED);
 }