Try ignoring her when she demands something. Completely ignore her like you can't hear her. When she throws a fit, send her to her room. Tell her she can come out when she is ready to be nice.
Be an excellent example of how to ask nicely. We don't realize what we sound like to our kids until we listen to them play "mommy." And oh was I shocked when I heard how I sound to my kids! So check yourself because ultimately she will follow your example far more than she will do what you say.
As far as the time she didn't want what you gave her because it wasn't a Barbie... If my kids do that (and they have) I gently explain that this is what I got them because I was trying to be nice (but don't guilt trip them, my brother does that and it doesn't work, ugh). If she still says she doesn't want it, then she doesn't get it. She gets nothing at all. Say something like "I'm sorry you don't like what I got you. I guess I'll have to take it back" and follow through.
It's also possible that she doesn't quite "get" what you mean when you tell her to 'ask nicely.' After she's calmed down, talk to her. Tell her you want to give her what she needs/wants, but she must ask nicely. Then practice it together. You go first, pretend she's the mommy and ask her "may I please have ____ ". Then have her ask you the same way. And when she does ask nicely give her praise as well. There will be times when she asks nicely for something that she can't have. Recognize for her how she asked the right way and then gently tell her why she can't have it. "I'm so glad you asked me nicely! I'm sorry, we can't have cookies right now because it's almost dinner time" or something like that.
My son is 6, and he does the same thing. He'll say something like "me want milk" (it's partly being silly, he knows the right way to say it). We've talked about the right way to ask a lot, so we just calmly say "how do you ask" and wait for him to say it the right way. But for a while, we would say "ok, lets ask the right way. Say, may I have milk please" and wait for him to say it. I'll warn you that it's not going to be an overnight change. It may take weeks, even a month or two, for her to change her habits (it takes adults 21 days to change a habit! Think of how that could be harder for a kid) But stick with it, be consistant, and you will see a gradual change in her behavior. And that's what discipline is all about, teaching her the right way to act. Hang in there mommy! :)