I cannot speak for the close voters on your question as I was not one, but as a guess I would say that they voted as such because the question lacks a "why".
In and of itself this is not an issue, but when you couple it with the fact that your question is, at face value, asking how to do something that appears unnecessary and/or complex and/or plain dumb, the question starts to look like an XY problem.
XY problem questions are some of the most reviled on the network, because they almost always end up wasting the valuable time of people who answer them at face value. Then the asker posts a comment on the answer saying that it doesn't work, and the answerer gets into a whole comment chain of trying to squeeze blood (the actual problem) out of a stone (the asker). And 9 times out of 10, it turns out that the asker doesn't understand the actual problem, or it cannot be solved, or it's completely unrelated to the question asked, or it would easily be solved if the asker had spent 5 seconds using their damn brain instead of running to Stack Overflow.
If you're lucky, someone will have already posted a comment on the question asking for the "why" before you post an answer, and the asker's response will demonstrate that the question is an XY problem, at which time you can go do something else while you wait for others to squeeze the blood from that stone.
If you're really lucky, you'll arrive at the question by the time all this has gone down and revealed the actual problem to be not understood/nonsensical/unsolvable, and can cast a quick close vote to get it consigned to the depths of hell from whence it came.
In short, always include the why when asking a question here. "Research purposes" or "s**ts and giggles" or "simple curiosity" are all valid reasons. Without that reason, we close voters will generally assume you don't know what you're asking about, and thus vote on your question accordingly.