38 comments

[ 3.1 ms ] story [ 54.2 ms ] thread
I like how it implements "418 I'm a teapot" as well :)
From the click through (http://www.ietf.org/rfc/rfc2324.txt):

2.1.4 WHEN method When coffee is poured, and milk is offered, it is necessary for the holder of the recipient of milk to say "when" at the time when sufficient milk has been introduced into the coffee. For this purpose, the "WHEN" method has been added to HTCPCP. Enough? Say WHEN.

Except it doesn't actually, it returns 'Unknown Error.' Disappointed. Maybe varnish isn't allowing it through?

    $ curl -v http://httpstat.us/418
    * About to connect() to httpstat.us port 80 (#0)
    *   Trying 75.101.145.87... connected
    * Connected to httpstat.us (75.101.145.87) port 80 (#0)
    > GET /418 HTTP/1.1
    > User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
    > Host: httpstat.us
    > Accept: */*
    > 
    < HTTP/1.1 418 Unknown Error
    < Server: nginx/0.7.67
    < Date: Tue, 15 Feb 2011 16:46:59 GMT
    < Content-Type: text/plain
    < Connection: keep-alive
    < Access-Control-Allow-Origin: *
    < Content-Length: 16
    < X-Varnish: 1137499688
    < Age: 0
    < Via: 1.1 varnish
    < 
    * Connection #0 to host httpstat.us left intact
    * Closing connection #0
    418 I'm a Teapot
You're still getting a 418 response there, just not the right status description.

Varnish is certainly stuffing us up a bit. There's a note about this at the bottom of the page.

If I did this again, I wouldn't deploy it to Heroku for this reason.

Very nice :) Perhaps add links to other useful testing services on that page?
Suggestions?
Please stop signing your posts.
If you type http://httpstat.us/1000, it returns:

100 Unknown Status

Nice catch. Seems we need to improve our regex. In our view, only three digit codes are valid.
I never realized how little browsers knew about http. Firefox treats everything like 200, including things like 305. Odd.
They don't support PUT or DELETE either, which means that people building RESTful APIs have to fudge it. Ugly.
Recent-ish WebKit and Firefox browsers do support PUT and DELETE in XHR requests. I'm pretty sure that any IE < 9 does not, not sure about IE 9 or Opera (though I'd guess Opera does support those verbs).
one major problem is HTML forms doesn't have a way to generate these.
I could invent one pretty easily. Instead of <form action="post">, it could be <form action="put">.
Counterexample: 401 pops up an authentication dialog.
The 300 series is not well supported. Most people don't even know that 307 exists - they always use 302.
I wonder where they used CouchDB and Cloudant for (listed at the bottom of the page).
I was intrigued by all the linked technologies, too. I've spent a day or so writing a site that I can't imagine being more than a few static pages, and it's just running on nginx on this VPS I bought.

I can understand monitoring for a site that -has- to be up (otherwise testing suites would start to break), but not the cloud database, let alone programmable markup or managed hosting (Heroku). Surely all that extra complexity is going to cost more in downtime than the time taken to set things up manually?

While we're honored to see that Cloudant plays a roll in the their app, I imagine the real answer to your question is the phrase "Experiment" at the bottom of the page. I imagine this is about learning/testing, not the most optimized way to skin the cat.
You're correct - it was all one big experiment so we threw way more technologies at it than we had to.

http://isitbeerti.me was another experiment of ours on the .NET platform

Heroku was a lot simpler than us spinning up (or paying for) a VPS. The other technologies were mostly just for fun.
http://httpstat.us/404 seems to dump HTML on my browser.
Yeah; it's sending back text/plain...

http://httpstat.us/404

HTTP/1.1 404 Not Found Server: nginx/0.7.67 Date: Tue, 15 Feb 2011 14:13:09 GMT Content-Type: text/plain Access-Control-Allow-Origin: * X-Varnish: 651017685 Age: 0 Via: 1.1 varnish Transfer-Encoding: chunked Proxy-Connection: Keep-Alive Connection: Keep-Alive Content-Encoding: gzip

(comment deleted)
18 lines of node.js to accomplish something similar - I use something similar as a function in my node.js scripts to be able to send a generic error template based on the code that I pass back to the function.

    var http = require('http');
    http.createServer(function (request, response)
    {
        var statusCode = request.url.substr(1, 3);
        response.writeHead(statusCode, { 'connection' : 'close', 'content-type' : 'text/html' });
        response.write('<html>');
        response.write('<head><title>' + statusCode + ' ' + http.STATUS_CODES[statusCode] + '</title></head>');
        response.write('<body bgcolor="white">');
        response.write('<center><h1>' + statusCode + ' ' + http.STATUS_CODES[statusCode] + '</h1></center>');
        response.write(' '.repeat(512));
        response.write('</body>');
        response.end('</html>');
    }).listen(8124, "0.0.0.0");

    String.prototype.repeat = function(num)
    {
        return new Array(num++).join(this);
    }
Here's a little something similar I whipped up using Flask (Python):

    import time
    from flask import Flask, make_response, request
    app = Flask(__name__)

    @app.route('/<int:status_code>')
    def return_status(status_code):
        response = make_response()
        response.status_code = status_code
        response.data = response.status
    
        sleep = request.args.get('sleep', None)
        if sleep is not None:
            time.sleep(int(sleep))
        return response

    if __name__ == '__main__':
        app.run(debug=True)
With a handy little feature, a "sleep" query string param that'll delay the response for the given number of seconds, which I've used to test how a client handles latency etc.

[BTW, looks like you're the Elliot Carlson I used to work with way back when. Hope life is treating you well these days! :)]

Hah, indeed! Email me some time - x at sublim dot nl
http://httpstat.us/000 shows Heroku Error

Oops, we seem to have a glitch in our system.

We've been notified; you might try reloading the page in a little while.

v 26026 2077752888

Kindly, can any one tell me why would we need such a website?