In the previous verses before today's passage begins, we discover Daniel's heart purpose. He has resolved that he would not eat certain things that would be considered off limits to this Jewish boy, Even though he was living in a pagan land, he considered the God's laws to be higher and he purposed in his heart to obey them despite the circumstances or the consequences. I don't have a list handy of the dietary laws God gave his chosen people, but you can go back to the law of Moses and find them. What we really see here is that Daniel must have been taught right by his Jewish parents as to what was right and wrong. It is apparent that Daniel found favor in the eyes of the man who was put in charge over them. He seems to like Daniel but was apprehensive that he would be in trouble if things went wrong. It appears that Daniel was confident enough that God would come through for them, and if He chose not to, then they would just go back to eating the king's food.
I like the way Daniel uses politeness in talking to the prince of eunuchs. He also included Shadrach, Meshach and Abednego in this plan. That meant that four men would be tested as to whether this would work. It did work! God came through for them. They looked good and more than that, God gave them wisdom which especially was used in Daniel's dealing with King Nebuchaddnezzer and later King Darias who was to take over the kingdom, defeating the Babylonians. What happens to us if we obey God rather than man. We have no guarantee. Daniel didn't either, but he put himself in the hands of God. I always intend to do the same, but Jesus didn't promise us anything, but possible tribulation. He even said in John 16:1-2 that they may even kill you thinking they are doing God a service. I am ready for that if it comes.