Of course it was appealing to his base. These are politicians. They say whatever they need to say in order for their supporters to continue to support them no matter how ridiculous or offensive their comments are.
Why is this even a topic that either side would argue about.......... (baffled)
Remember when McCain scolded and contradicted that woman who would denounce then-candidate Obama as an America-hating Muslim?
It takes just one counter-example to demonstrate an absolute assertion is wrong. So, your denunciation, "They [politicians] say whatever they need to say...", is categorically false.
Did you ever wonder why Hillary used no part of the Steele dossier in her campaign? Just imagine, it might be because quite a few - yes, even among politicians - would accept limits to what they do or say, even though in the age of Trump these barriers are being dismantled at an astonishing rate.