Guest User

Untitled

a guest
Jun 18th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. response = new ResponseEntity<MyDto>(myDto, myHeaders, HttpStatus.OK);
  2.  
  3. response = ResponseEntity.ok().headers(myHeaders).body(myDto);
  4.  
  5. // constructor
  6. MultiValueMap<String, String> headers = ...;
  7. ResponseEntity<String> resp = new ResponseEntity(headers, HttpStatus.OK);
  8.  
  9. // builder
  10. ResponseEntity<String> resp = ResponseEntity.ok()
  11. .header("header1", "value1")
  12. .header("header2", "value2")
  13. .build();
Add Comment
Please, Sign In to add comment