Skip to content

Instantly share code, notes, and snippets.

@rokinmaharjan
Last active December 11, 2018 06:01
Show Gist options
  • Select an option

  • Save rokinmaharjan/df4ed2da0b32dfbf4d12d8490dabd504 to your computer and use it in GitHub Desktop.

Select an option

Save rokinmaharjan/df4ed2da0b32dfbf4d12d8490dabd504 to your computer and use it in GitHub Desktop.
ResponseEntity example
# Method 1
@PostMapping("/users")
public ResponseEntity<List<String>> addUsers() throws IOException {
return ResponseEntity.ok().body(this.userService.addUsers());
}
# Method 2
@DeleteMapping()
@ResponseStatus(HttpStatus.NO_CONTENT)
public void deleteIndex() throws IOException {
this.esRepository.deleteIndex();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment