a red coffee pot

Coffees served today:

This server serves coffees as proposed in famous RFC 2324. If you want one, simply send a HTTP (or HTTPS) request with BREW method using curl.

curl -X BREW http://git.dpolakovic.space

Your coffee will be brewed in one of my two coffee pots. Red and white one. You can also pick coffee pot by name, while typing the the URL. You can use their canonical names from the RFC (pot-0 and pot-1) or their verbose variants (red-coffee-pot and white-coffee-pot). [*]

Before specifying the pot in BREW request, make sure it's not being cleaned or empty by making a request with GET method.

curl -X GET http://git.dpolakovic.space/white-coffee-pot

If your chosen coffee pot is empty, you have to wait until the server refills the coffee beans or you can refill them yourself with POST method.

curl -X POST http://git.dpolakovic.space/white-coffee-pot

If you preffer coffee with some additions, you can include them in your request. If they are available, the server will happily prepare your order.

# Coffee with cream curl -X BREW \ -H "Content-Type: application/coffee-pot-command" \ -H "Accept-Additions: Cream" \ http://git.dpolakovic.space/ # Coffee with chocolate and cream curl -X BREW \ -H "Content-Type: application/coffee-pot-command" \ -H "Accept-Additions: Chocolate, Cream" \ http://git.dpolakovic.space/ # Or as substitution for WHEN method (q values = quantity in ml) curl -X BREW \ -H "Content-Type: application/coffee-pot-command" \ -H "Accept-Additions: Whole-Milk;q=50" \ http://git.dpolakovic.space/

As seen in the last example, the WHEN method is substitued by quantity ordering. You don't have to hold the connection open until your milk is poured. Simply declare how much milk (or any other addition) you would like to have in your coffee.

This server offers updated list of additions, to fit modern coffee trends. The original RFC didn't specified plant based milk types like pea milk or other addition types like nowadays very popular pumpkin puree or cinnamon. Complete offer of additions and coffee pots can be found with PROPFIND method.

curl -X PROPFIND http://git.dpolakovic.space

If you are not currenttly on Unix or Unix-like system, you can request your coffee using telnet.

telnet git.dpolakovic.space 80 BREW / HTTP/1.0 Host: git.dpolakovic.space

I even made a perl script which offers simplified way to request coffee from any machine. You can find it right here on this git server as htcpcp-requestor.

The counter you see stores BREW method request from past 48 hours and list all from midnight of your timezone. Link to the source code is available also here on this git server.

I was also thinking about implementing the Coke protocol, but I don't own any soda vending machine. If you have one and you are willing to donate it for the good of the Internet, please send me an email.



* Quick tought about coffee pot numbering
The RFC 2324 defines the canonical pot name in format "pot-[integer]". This is confusing as there is no first known member of integer group. There is however first known member of integer data type which is 0, but the mathematical first member of the type could also be -2,147,483,648. On the other hand, most natural number asigned to first member of any group (even group of coffee pots) which is also member of integer group is 1. Therefore, the red coffee pot has working aliases: pot-2 (since the pot-0 and pot-1 redirecting to same pot could evoke bug behaviour), pot--2147483648 and pot-n2147483648. The white coffee pot is then pot-1, even tough it is not the default option. To avoid any possible confusion from numbering coffee pots, I also implemented their human readable color based names, which is present throughout this guide.