Enhancing webserver Request object so it emulates PhantomJS behaviour