Answers for "reponse entity as result spring controller"

0

reponse entity as result spring controller

@RequestMapping("/handle")
 public ResponseEntity<String> handle() {
   URI location = ...;
   HttpHeaders responseHeaders = new HttpHeaders();
   responseHeaders.setLocation(location);
   responseHeaders.set("MyResponseHeader", "MyValue");
   return new ResponseEntity<String>("Hello World", responseHeaders, HttpStatus.CREATED);
 }
Posted by: Guest on October-23-2021

Code answers related to "reponse entity as result spring controller"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language