{"action":"created","issue":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1386","labels_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1386/labels{/name}","comments_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1386/comments","events_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1386/events","html_url":"https://github.com/jhipster/generator-jhipster/issues/1386","id":68853790,"number":1386,"title":"REST semantics for POST / PUT","user":{"login":"ddewaele","id":364310,"avatar_url":"https://avatars.githubusercontent.com/u/364310?v=3","gravatar_id":"","url":"https://api.github.com/users/ddewaele","html_url":"https://github.com/ddewaele","followers_url":"https://api.github.com/users/ddewaele/followers","following_url":"https://api.github.com/users/ddewaele/following{/other_user}","gists_url":"https://api.github.com/users/ddewaele/gists{/gist_id}","starred_url":"https://api.github.com/users/ddewaele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddewaele/subscriptions","organizations_url":"https://api.github.com/users/ddewaele/orgs","repos_url":"https://api.github.com/users/ddewaele/repos","events_url":"https://api.github.com/users/ddewaele/events{/privacy}","received_events_url":"https://api.github.com/users/ddewaele/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-16T06:16:54Z","updated_at":"2015-04-16T16:53:31Z","closed_at":null,"body":"Although create/update methods (POST / PUT) are generated on the RestController, the generated Angular controllers only seems to use the ```PUT```, even for creating new records.\r\n\r\nInternally the ```update``` method then delegates back to the create ```method``` depending on the existence of an id.\r\n\r\n```\r\n    @RequestMapping(value = \"/groups\",\r\n        method = RequestMethod.PUT,\r\n        produces = MediaType.APPLICATION_JSON_VALUE)\r\n    @Timed\r\n    public ResponseEntity<Void> update(@Valid @RequestBody Group group) throws URISyntaxException {\r\n        log.debug(\"REST request to update Group : {}\", group);\r\n        if (group.getId() == null) {\r\n            return create(group);\r\n        }\r\n        groupRepository.save(group);\r\n        return ResponseEntity.ok().build();\r\n    }\r\n```\r\n\r\nIMHO it would be cleaner if Angular would issue a ```POST``` when creating new entities, and only use the ```PUT``` to update them."},"comment":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/comments/93783666","html_url":"https://github.com/jhipster/generator-jhipster/issues/1386#issuecomment-93783666","issue_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1386","id":93783666,"user":{"login":"jdubois","id":316835,"avatar_url":"https://avatars.githubusercontent.com/u/316835?v=3","gravatar_id":"","url":"https://api.github.com/users/jdubois","html_url":"https://github.com/jdubois","followers_url":"https://api.github.com/users/jdubois/followers","following_url":"https://api.github.com/users/jdubois/following{/other_user}","gists_url":"https://api.github.com/users/jdubois/gists{/gist_id}","starred_url":"https://api.github.com/users/jdubois/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdubois/subscriptions","organizations_url":"https://api.github.com/users/jdubois/orgs","repos_url":"https://api.github.com/users/jdubois/repos","events_url":"https://api.github.com/users/jdubois/events{/privacy}","received_events_url":"https://api.github.com/users/jdubois/received_events","type":"User","site_admin":false},"created_at":"2015-04-16T16:53:31Z","updated_at":"2015-04-16T16:53:31Z","body":"I don't know this book, but if you read the end of the article, you will see that we do is perfectly normal."}}