Ideally you would remove them from the car, take them apart, bead blast the body, properly degrease them and hang from coat hangers for proper painting. Few people bother doing all that but wonder why the paint starts peeling off in a year or two.
I painted as part of a brake system overhaul, and while it's more work, really the best way to do it.
Detached the calipers and brackets, cleaned them with a wire wheel, rebuilt them, and painted with Rustoleum caliper paint. It's three months short of six years, and they're holding up fine.
If a parts washer or blaster is available, that's the way to go, but most people don't have one, so another method has to be used to perform what is the most vital tasks.
Even with a chemical solution, brake dust caked into the porous surfaces of the castings is going to require some mechanical agitation to remove; there's no way around it. Don't think about using a canned brake cleaner, even if you're willing to buy a case of it, because it might take that, or more. Gas, or other powerful solvent? As a kid, my dad had me clean dirty parts with gas, but not something I'd do now.
I don't recall exactly why, but I chose Rustoleum's silver caliper paint over VHT, Krylon, and the others. Might have been rated temperature, but it was the combination of factors. A $6 can did four calipers and brackets with three coats, and remnants for potential touch-ups, which I haven't had to do. I'm sure the epoxy-based coatings are better, and considered them briefly, but ~6x-10x cost better, as well as being trickier to use?
In my book anything that's worth doing is worth doing right. Would never consider spraying everything, or some things and not others, like a lot of jobs people do.
Still very satisfying to see the results of that work, when looking at the wheels, or washing the car.