{"action":"created","issue":{"url":"https://api.github.com/repos/JulianBirch/cljs-ajax/issues/88","labels_url":"https://api.github.com/repos/JulianBirch/cljs-ajax/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/JulianBirch/cljs-ajax/issues/88/comments","events_url":"https://api.github.com/repos/JulianBirch/cljs-ajax/issues/88/events","html_url":"https://github.com/JulianBirch/cljs-ajax/pull/88","id":97892999,"number":88,"title":"Proper handling of response with 204 status code","user":{"login":"honzabrecka","id":1021827,"avatar_url":"https://avatars.githubusercontent.com/u/1021827?v=3","gravatar_id":"","url":"https://api.github.com/users/honzabrecka","html_url":"https://github.com/honzabrecka","followers_url":"https://api.github.com/users/honzabrecka/followers","following_url":"https://api.github.com/users/honzabrecka/following{/other_user}","gists_url":"https://api.github.com/users/honzabrecka/gists{/gist_id}","starred_url":"https://api.github.com/users/honzabrecka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/honzabrecka/subscriptions","organizations_url":"https://api.github.com/users/honzabrecka/orgs","repos_url":"https://api.github.com/users/honzabrecka/repos","events_url":"https://api.github.com/users/honzabrecka/events{/privacy}","received_events_url":"https://api.github.com/users/honzabrecka/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-29T09:16:37Z","updated_at":"2015-07-29T12:32:48Z","closed_at":"2015-07-29T12:31:54Z","pull_request":{"url":"https://api.github.com/repos/JulianBirch/cljs-ajax/pulls/88","html_url":"https://github.com/JulianBirch/cljs-ajax/pull/88","diff_url":"https://github.com/JulianBirch/cljs-ajax/pull/88.diff","patch_url":"https://github.com/JulianBirch/cljs-ajax/pull/88.patch"},"body":"Hi, I'm dealing with a JSON based API, that, when deleting an entity, returns the 204 status code and empty body. It's right behaviour as it follows [RFC](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html): The 204 response MUST NOT include a message-body, and thus is always terminated by the first empty line after the header fields. The problem is how cljs-ajax handles such as responses: it calls `:error-handler` even though everything went OK.\r\n\r\nI know the exception is thrown by `goog.json/parse` function, because empty string is invalid JSON. But I think that cljs-ajax should handle this case properly, so when 204, do not try to parse body (return `nil`)."},"comment":{"url":"https://api.github.com/repos/JulianBirch/cljs-ajax/issues/comments/125936571","html_url":"https://github.com/JulianBirch/cljs-ajax/pull/88#issuecomment-125936571","issue_url":"https://api.github.com/repos/JulianBirch/cljs-ajax/issues/88","id":125936571,"user":{"login":"honzabrecka","id":1021827,"avatar_url":"https://avatars.githubusercontent.com/u/1021827?v=3","gravatar_id":"","url":"https://api.github.com/users/honzabrecka","html_url":"https://github.com/honzabrecka","followers_url":"https://api.github.com/users/honzabrecka/followers","following_url":"https://api.github.com/users/honzabrecka/following{/other_user}","gists_url":"https://api.github.com/users/honzabrecka/gists{/gist_id}","starred_url":"https://api.github.com/users/honzabrecka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/honzabrecka/subscriptions","organizations_url":"https://api.github.com/users/honzabrecka/orgs","repos_url":"https://api.github.com/users/honzabrecka/repos","events_url":"https://api.github.com/users/honzabrecka/events{/privacy}","received_events_url":"https://api.github.com/users/honzabrecka/received_events","type":"User","site_admin":false},"created_at":"2015-07-29T12:32:48Z","updated_at":"2015-07-29T12:32:48Z","body":"Great to hear, thanks!"}}