Allow to provide the Request object when calling resource.url()

This would greatly simplify unit testing of resource instances where a full resource tree does not exist.