Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- response = new ResponseEntity<MyDto>(myDto, myHeaders, HttpStatus.OK);
- response = ResponseEntity.ok().headers(myHeaders).body(myDto);
- // constructor
- MultiValueMap<String, String> headers = ...;
- ResponseEntity<String> resp = new ResponseEntity(headers, HttpStatus.OK);
- // builder
- ResponseEntity<String> resp = ResponseEntity.ok()
- .header("header1", "value1")
- .header("header2", "value2")
- .build();
Add Comment
Please, Sign In to add comment