spring-security-react-ant-design-polls-app
spring-security-react-ant-design-polls-app copied to clipboard
What do these lines of code do?
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"));
Hello, it means it will return 201 HTTP response and sets the Location in this case location
in the response headers