tests for HttpRequest and some bugfixes