Well, before any of it, set your phone/iPad. laptop to remember the Wi-Fi password so anda only have to ask once.
Then anda could say, "Hey, I need to (something on the internet that the person knows is important to you), but I don't have your Wi-Fi info. Can anda put it for me?"
Then your good. If they say no, anda just smile kinda sadly, but in an understanding way and say. 'Okay. it's cool." Then anda ask if anda can use their devise.
This is the one i always use, but if i'm in a menyeberang, salib mood, I'll just straight up ask. >u<