Some corrections and enhancements in http.
Modify main to demonstrate http utils.