Last active
August 29, 2015 14:15
-
-
Save edwise/86017cfb42740f77de27 to your computer and use it in GitHub Desktop.
How to do a RESTful POST without Spring Hateoas (link)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HttpHeaders httpHeaders = new HttpHeaders(); | |
httpHeaders.setLocation( | |
ServletUriComponentsBuilder | |
.fromCurrentRequest() | |
.path("/{id}") | |
.buildAndExpand(entity.getId()) | |
.toUri()); | |
return new ResponseEntity<>(httpHeaders, HttpStatus.CREATED); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment