Hacker News new | ask | show | jobs
by galaxyLogic 1124 days ago
There is no shortage of numbers. I wonder if it would make sense for every web-server ot have its own status-code if up and running? Of course they would have to be registered somewhere.
4 comments

The whole point of protocols is to get the same results on the same situation regardless of server implementation. What could possibly be gained by returning intentionally different error codes?
I wasn't thinking of "error-codes' but rather "status codes". An ID of a resource, running on the web could unify it uniquely, not really the physical machine but the server-application we are talking to. But maybe it's enough that we have URIs?
there already is a system kinda like that. try this command to see the unique status code representing the fact that HN's server is up and running:

    curl https://news.ycombinator.com/ | base64
So... if the API I use switches from Apache to nginx, I have to rewrite all my success/error handling?
Of course not, the error-codes should remain the same standard ones as always. I'm saying there are more numbers than those, which could be used for some as yet unidentified purpose.

Perhaps a unique status-code of a server could identify things like the version of content served by it.

This has nothing to do with servers though. It's in context to the requested resource. If you want to check if a server is alive it's happening several layers below an HTTP request.
Right, but, the word "server" is often used to refer not to the physical machine, or even a virtual machine, but to the "web-server" meaning a running instance of Apache nginx or IIS. etc.

Not saying such a feature is needed just wondering could it be useful for some purpose.