title: Two identical REST mappings with different HTTP request types
body: <p>Let's assume we have two methods on the REST controller:</p>
  
  <pre><code>@ResponseStatus(HttpStatus.OK)
  @RequestMapping(value = "/{userId}", method = RequestMethod.GET)
  @ResponseBody
  public UserDTO showUserDetails(@PathVariable("userId") Long userId) {
  /* code here */
  }
  
  @ResponseStatus(HttpStatus.ACCEPTED)
  @RequestMapping(value = "/{userId}", method = RequestMethod.POST)
  @ResponseBody
  public UserDTO editUser(@PathVariable("userId") Long userId, UserDTO userToEdit) {
      /* code here */
  }
  </code></pre>
  
  <p>So we have two identical URIs mappings, but supporting different <strong>HTTP</strong> requests. <strong>My question is: is this approach acceptable in terms of designing APIs?</strong> Or it is better to map second method to something like <strong><em>/{userId}/edit</em></strong> ? </p>
  
  <p>Also, when using hateoas paradigm, the response will look somewhat strange:</p>
  
  <pre><code>"links":[{"rel":"self","href":"http://1localhost:8080/root/users/1"},{"rel":"edit","href":"http://localhost7:8080/root/users/1"}]
  </code></pre>
  
  <p>With 2 different URIs looking identical. </p>