That depends. In real life, I'll become very suspicious. That just doesn't happen. In my experience they're most likely to need something from me, or they want to boost my self esteem with an empty gesture. Online however, I get hit on genuinely quite a lot. Mostly guys, but not that that's a bad thing. I take the interest as a compliment.
Back when I was still single I found it quite intimidating to tell them off. But if they were to ask me now I'd probably just tell them that I'm already in a relationship without being overly fearful or shy. With that said, it also depends on the person, of course. There's sadly still a lot of people whom are aggressively homophobic.