this is my current simple function
def endpoint_is_valid(url: str) -> bool:
try:
response = requests.post(
url,
json={
# here I have some dummy data
}
)
return response.status_code == 200
except requests.exceptions.RequestException:
return False
in this function I am doing a "test" request to check if the request is successful so I can make further requests in the future
however, since i just wanna check if this url is available, I think that this code is not good, since I send nonsense data
I tried to make a get request, however I dont get response code 200,
I have multiple urls where I have to check their availability so the solution should be applicable more generally