I have number of APIs which is not being hosted by me, so I have no control of the API itself. What I'm trying to achieve is to check whether the APIs is online or not.I already tried several way:
Sent a blank HttpWebRequest
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
if (response.StatusCode == HttpStatusCode.NotFound)
return false;
return true;
}
Ping the server
But somehow my end result is not accurate enough. It shows offline but when I manually try to invoke the API, it seems okay. Anybody got a solution?
What about using an API Health Check service? Some links that can help you:
https://www.runscope.com/
https://www.getpostman.com/docs/postman/monitors/intro_monitors
https://blog.runscope.com/posts/build-a-health-check-api-for-services-underneath-your-api
https://nordicapis.com/monitor-the-status-of-apis-with-these-4-tools/
https://apigee.com/about/blog/technology/api-health-free-tool-monitoring-apis-public-beta-now
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With