The RFCs are the place to go, but there are already dedicated programs that can speak HTTP as a front end to something.
POE is one, and
Jellybean is another. Of course, there's nothing wrong with using
HTTP::Daemon, which handles many of the details for you.