Added a HTTP wrapper for DRY-ing up the code.