req.setEncoding isn't a method. It should be in headers.