I've edited my previous post with this question "Which command do you use to test url ?"
Should I give you an answer with an example in python or bash? This is an elementary operation ... and your question is clearly not just that. You are clearly going to use the answer... so I need to know where you are going to use it ... in bash or python script