{"action":"created","issue":{"url":"https://api.github.com/repos/advantageous/qbit/issues/748","repository_url":"https://api.github.com/repos/advantageous/qbit","labels_url":"https://api.github.com/repos/advantageous/qbit/issues/748/labels{/name}","comments_url":"https://api.github.com/repos/advantageous/qbit/issues/748/comments","events_url":"https://api.github.com/repos/advantageous/qbit/issues/748/events","html_url":"https://github.com/advantageous/qbit/issues/748","id":164106363,"number":748,"title":"How to send different HTTP status codes in the same method callback","user":{"login":"brunoais","id":639467,"avatar_url":"https://avatars.githubusercontent.com/u/639467?v=3","gravatar_id":"","url":"https://api.github.com/users/brunoais","html_url":"https://github.com/brunoais","followers_url":"https://api.github.com/users/brunoais/followers","following_url":"https://api.github.com/users/brunoais/following{/other_user}","gists_url":"https://api.github.com/users/brunoais/gists{/gist_id}","starred_url":"https://api.github.com/users/brunoais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunoais/subscriptions","organizations_url":"https://api.github.com/users/brunoais/orgs","repos_url":"https://api.github.com/users/brunoais/repos","events_url":"https://api.github.com/users/brunoais/events{/privacy}","received_events_url":"https://api.github.com/users/brunoais/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-06T15:37:48Z","updated_at":"2016-07-06T23:44:14Z","closed_at":null,"body":"Hi,  \r\nI'm implementing a service that is planned to work such that the success of a request can either return either `201 Created` or `200 OK` depending if a resource was either created or replaced. The HTTP method will be the same: `PUT`.\r\n\r\nI've been reading the documentation but I can't find any way of doing that. The method that responds would have to know what to return at compile time through the annotation. How do I set a status code individually for each request?\r\n\r\nAdditionally, I need the library that I use to work asynchronously. I already noticed this is async by default but I need any answer you give to be compatible with handling an HTTP request asynchronously.\r\n\r\nThanks in advance."},"comment":{"url":"https://api.github.com/repos/advantageous/qbit/issues/comments/230940420","html_url":"https://github.com/advantageous/qbit/issues/748#issuecomment-230940420","issue_url":"https://api.github.com/repos/advantageous/qbit/issues/748","id":230940420,"user":{"login":"RichardHightower","id":382678,"avatar_url":"https://avatars.githubusercontent.com/u/382678?v=3","gravatar_id":"","url":"https://api.github.com/users/RichardHightower","html_url":"https://github.com/RichardHightower","followers_url":"https://api.github.com/users/RichardHightower/followers","following_url":"https://api.github.com/users/RichardHightower/following{/other_user}","gists_url":"https://api.github.com/users/RichardHightower/gists{/gist_id}","starred_url":"https://api.github.com/users/RichardHightower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RichardHightower/subscriptions","organizations_url":"https://api.github.com/users/RichardHightower/orgs","repos_url":"https://api.github.com/users/RichardHightower/repos","events_url":"https://api.github.com/users/RichardHightower/events{/privacy}","received_events_url":"https://api.github.com/users/RichardHightower/received_events","type":"User","site_admin":false},"created_at":"2016-07-06T23:44:14Z","updated_at":"2016-07-06T23:44:14Z","body":"You could\r\n\r\n```java\r\n  @RequestMapping(value = \"/helloj7\", code = 221)\r\n```\r\n\r\nYou can also do this:\r\n\r\n```java\r\n      @RequestMapping(method = RequestMethod.GET)\r\n        public void ping2(Callback<HttpTextResponse> callback) {\r\n\r\n            callback.returnThis(HttpResponseBuilder.httpResponseBuilder()\r\n                    .setBody(\"hello mom\").setContentType(\"mom\")\r\n                    .setCode(777)\r\n                    .buildTextResponse());\r\n        }\r\n```"}}
{"actor":{"display_login":"RichardHightower"}}