{"action":"created","issue":{"url":"https://api.github.com/repos/Smarina/Helpers/issues/1","labels_url":"https://api.github.com/repos/Smarina/Helpers/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/Smarina/Helpers/issues/1/comments","events_url":"https://api.github.com/repos/Smarina/Helpers/issues/1/events","html_url":"https://github.com/Smarina/Helpers/pull/1","id":125353342,"number":1,"title":"Success option is now optional","user":{"login":"kidandcat","id":3855826,"avatar_url":"https://avatars.githubusercontent.com/u/3855826?v=3","gravatar_id":"","url":"https://api.github.com/users/kidandcat","html_url":"https://github.com/kidandcat","followers_url":"https://api.github.com/users/kidandcat/followers","following_url":"https://api.github.com/users/kidandcat/following{/other_user}","gists_url":"https://api.github.com/users/kidandcat/gists{/gist_id}","starred_url":"https://api.github.com/users/kidandcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kidandcat/subscriptions","organizations_url":"https://api.github.com/users/kidandcat/orgs","repos_url":"https://api.github.com/users/kidandcat/repos","events_url":"https://api.github.com/users/kidandcat/events{/privacy}","received_events_url":"https://api.github.com/users/kidandcat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-07T09:03:30Z","updated_at":"2016-01-11T13:37:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Smarina/Helpers/pulls/1","html_url":"https://github.com/Smarina/Helpers/pull/1","diff_url":"https://github.com/Smarina/Helpers/pull/1.diff","patch_url":"https://github.com/Smarina/Helpers/pull/1.patch"},"body":"Success option is now optional"},"comment":{"url":"https://api.github.com/repos/Smarina/Helpers/issues/comments/170551093","html_url":"https://github.com/Smarina/Helpers/pull/1#issuecomment-170551093","issue_url":"https://api.github.com/repos/Smarina/Helpers/issues/1","id":170551093,"user":{"login":"Smarina","id":8239362,"avatar_url":"https://avatars.githubusercontent.com/u/8239362?v=3","gravatar_id":"","url":"https://api.github.com/users/Smarina","html_url":"https://github.com/Smarina","followers_url":"https://api.github.com/users/Smarina/followers","following_url":"https://api.github.com/users/Smarina/following{/other_user}","gists_url":"https://api.github.com/users/Smarina/gists{/gist_id}","starred_url":"https://api.github.com/users/Smarina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Smarina/subscriptions","organizations_url":"https://api.github.com/users/Smarina/orgs","repos_url":"https://api.github.com/users/Smarina/repos","events_url":"https://api.github.com/users/Smarina/events{/privacy}","received_events_url":"https://api.github.com/users/Smarina/received_events","type":"User","site_admin":false},"created_at":"2016-01-11T13:37:24Z","updated_at":"2016-01-11T13:37:24Z","body":"A la hora de realizar peticiones a una API siempre es conveniente corroborar que se han producido los cambios esperados (creación de registro con POST o edición con PUT) y para ello lo ideal es recibir una respuesta (aunque sea sin contenido) cuya cabecera incluya el resultado de la operación (códigos de respuesta 2XX, 5XX o los que fueran) para poder operar en función de dicho resultado.\r\n\r\nEl hecho de mandar peticiones POST y PUT sin cerciorarse de que han producido el efecto esperado puede derivar en operaciones inconsistentes. Aunque el back-end esté programado por ángeles, el propio servidor puede fallar en un momento dado resultando en que la operación no se realiza correctamente, devolviendo un código 5XX que el front-end no va a interpretar.\r\n\r\nMe parece adecuado usar este método (sin función Success) en algún momento dado por pura comodidad, pero como norma general veo más practico obligar en cierto modo al usuario de la herramienta a seguir las \"best practices\".\r\n\r\nUn par de opiniones que lo avalan:\r\nhttp://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#useful-post-responses\r\nhttp://stackoverflow.com/questions/1829875/is-it-ok-by-rest-to-return-content-after-post"}}