I need to create a function that returns if a URL is reachable or valid.
I am currently using something like the following to determine a valid url:
You could check http status code.
Here is a code you could use to check that an url returns 2xx or 3xx http code to ensure the url works.
Hope this helps!