Over on *cough* TikTok, mostly-retro influencer MLGonzo (he has a COBOL beard, but also talks about contemporary geek stuff) states:
Everyone should have their own favourite HTTP request response codes!
And that’s true, of course! Just a day after I watched this clip I checked in at a hotel, and by coincidence, the room number was my favorite HTTP response code!
Everybody knows HTTP 404 (Not Found), and every other backend jester will probably pick HTTP 418 (I’m a Teapot) as their favorite. But HTTP 204 is special and weird, and it’s my favorite for nostalgic reasons as well.
GET /some/url HTTP/1.1 Host: heckmeck.de HTTP/1.1 204 No Content
What do you mean, “No Content”? No response body, no redirect? What should I do with that?
Well, nothing, and that’s the beauty of it! Back in the late 1990s, it was the go-to solution to make a browser-based chat server work:
- Everything was frame-based (a proper <FRAMESET>, in uppercase)
- You didn’t have an XMLHttpRequest to issue custom requests
- You couldn’t even rely on JavaScript (of course, JavaScript was there, but many tech-savy power users had it deactivated, and you didn’t want to piss them off – using JavaScript was mostly fine, but requiring it for your website to function was lame)
- You didn’t want to reload the chat input frame every time the user typed something (because submitting the single-input chat form would trigger a POST-clear-load-render cycle – slow, brittle-looking, and flickering!)
- But you still wanted the chat to work in the browser – without any plugins and especially without launching a Java applet, which was a tedious, ugly process (and lame)
“No Content” to the rescue! When the server responds with HTTP 204, you can submit the input form as much as you like, without the browser ever repainting anything. Oh, the response is No Content? Let’s just keep the current document, then! Observe this <iframe>:
Sadly, you can only really “observe” what happens in the browser debugging tools – cooking up a purely HTTP-based toy chat server would have been fun, but allowing even the tiniest amount of user-submitted content on my website is too much of a headache, sadly…
Anyway… the trip to Siegen was nice, and this was a nice trip down memory lane. So much content about no content! :)