Support req.toUrl and context.readResource.