Why do I get headache after eating something sweet?

Many things. There is a long list of things that can trigger migraines or headaches. Maybe is not the "sweet" but something else causing it. Substances hidden in certain foods may trigger them. Sulfites in certain wine, also chocolates, some fruits like straberries, bananas, meat, cheese may trigger it.