Both are okay, but different. "I had to drop off a cake for a friend" could mean, for example, that I had to drop off a cake at the school for a friend who had promised to make a cake but was unable to deliver it herself.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.