RESTClient icon indicating copy to clipboard operation
RESTClient copied to clipboard

Hang on 204 responses

Open loian opened this issue 14 years ago • 6 comments

Still have the problem in 2.0.3. Experienced with POST request.

loian avatar Oct 03 '12 11:10 loian

I've seen this as well on POST, PUT, and delete requests. The execution dialog (with the Abort button) just stays open indefinitely when the server returns a 204. More annoying than problematic.

phoellig avatar Jan 25 '13 19:01 phoellig

RESTClient being a testing tool for many of us should always allow responses without body even if it violates HTTP. spec

pajaco avatar Feb 08 '13 14:02 pajaco

204 responses without a body don't violate the spec. RESTCient shouldn't wait for a body when getting a 204.

chasetec avatar Jul 11 '13 18:07 chasetec

Wait is there a "rest spec" which says thou must return a response with a 204, or 200 for that matter? Which is when I happen to see this happen.

creechy avatar Jul 24 '13 18:07 creechy

FWIW I was able to tweak the extension pretty easily to fix this problem. At least for me it was related to the Content-Type being set to application/json but no response-data being returned, which some JSON method doesn't like.

To fix, I tweaked restclient.main.js, and in the displayJson function, wrapped the offending call with a check:

    if (reformatted) {
            $.JSONView(reformatted, $('#response-body-highlight pre'));
    }

creechy avatar Jul 24 '13 22:07 creechy

Same issue here on 2.0.3. I have a 201 request that has the "Accept: application/json" header set, but which does not return a body, and hangs upon execution. Removing the header solves the problem. This is annoying because you are typically testing this together with many other requests that DO need to return JSON, so you have to change the header settings in the client all the time.

Catweasle avatar Jan 31 '14 09:01 Catweasle