If you'd like to use something similar on Erlang, take a look on katt project: https://github.com/klarna/katt/blob/master/doc/example-httpb...
If you like KATT/Apiary/HTTP mockeries, keep an eye on https://github.com/andreineculau/hyperrest-bin and https://github.com/klarna/katt