Added tests and functionality for WebRequest.