welcome to hcm
thanks for the query
sometimes gastrointestinal problems in stomach or bowel can cause headache
some conditions can cause constipation
and headache, though constipation is not directly related to headache.you can take nsaids for temporary relieve of headache.
is it the first time or you have this problem for long time?
drink 3 to 4 lit of water per day
take more fruit and green leafy veg
avoid fatty foods. if you still getting after all these modification then consult your physician.