spring-security-react-ant-design-polls-app icon indicating copy to clipboard operation
spring-security-react-ant-design-polls-app copied to clipboard

What do these lines of code do?

Open gistmap opened this issue 5 years ago • 1 comments

hello, I can't understand what these line of code do.

URI location = ServletUriComponentsBuilder
                .fromCurrentContextPath().path("/users/{username}")
                .buildAndExpand(result.getUsername()).toUri();

return ResponseEntity.created(location).body(new ApiResponse(true, "User registered successfully"));

gistmap avatar Dec 12 '19 07:12 gistmap

Hello, it means it will return 201 HTTP response and sets the Location in this case location in the response headers

jhefreyzz avatar Dec 15 '19 08:12 jhefreyzz