mostly complete functionality for http requests.