Hazrat Humaid narrates that it was asked from Sayyiduna Anas (may Allah be pleased with him), can a fasting person get cupping done? He replied that we used to dislike cupping for a fasting person due to the hardship and weakness it causes. But he did not narrate this as a marfu’ (directly from the Prophet). And he said that the Noble Prophet (peace and blessings be upon him) had cupping done on his blessed head due to a pain while he was in the state of ihram.
Hadith Referenceصحيح ابن خزيمه / جماع أبواب ذكر أفعال اختلف الناس فى إباحته للمحرم، نصت سنة النبى صلى الله عليه وسلم أو دلت على إباحتها / 2658