Is there a word for "pretending to ask?"

Is there a word for when you're asking someone something only to go through the motions and uphold social norms?
For instance, when you ask "Can I come in?" before just going in their house or whatever (in particular, you do not reasonably expect the answer to be "no," and they're also expected to go through the "routine" when they answer).


Solution 1:

The term for this sort of nicety is phatic communication:

phatic a
Of or relating to communication used to perform a social function rather than to convey information or ideas.
TFD Online

It includes questions that don't expect a literal answer.

Solution 2:

Acts like this fall under the category of politesse. Basically, the adherence to social norms and decourousness.

In a roundabout way, the question can also be said to be rhetorical. You are asking a question for which the answer is obvious or implied and you don't really expect an answer.