Sam-I-Am on Web Development

Sam Foster on the web and web-ish software developmen

Thursday, January 20, 2005

HTTP Status 204

This was new to me. The HTTP Response header can use a status code '204 No Content'. This tells the user-agent not to expect any response content, and so to not refresh the current page. For simple interactions where you want to keep the server current on a users selections it looks useful.

Here's some (old but interesting) browser test results. There's apparently some disagreement on whether response content accompanying a 204 is an error, or should just be ignored. The safe bet seems to be to not send any content body.

1 Comments:

At 9:31 AM, Anonymous 2ge said...

hello, nice entry, http status 204 is very good, I'm just programming shop, with shopping cart, using this one...
When user clicks on image (checkbox) item is added to cart, after that image changes to "checked". After clicking again it changes to "unchecked" and it is thrown from a cart. With no refreshing. very nice...

 

<< Home