added support for http HEAD requests, and refactored http GET requests to take advantage of this.