At 2600Hz, we recently converted our REST
webserver from
Mochiweb/Webmachine
to Cowboy, with
cowboy\_http\_rest
giving us a comparable API to process our REST requests with. One
feature that was missing, however, was an equivalent to Webmachine's
{halt,
StatusCode} return. While there has been
chatter about adding this
to cowboy\_http\_rest, we've got a function that emulates the behaviour
pretty well (this is cleaned up a bit from our actual function, removing
project-specific details).