Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

REST API health check

Tags:

rest

c#

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:

  1. Sent a HTTP request to the API endpoint with HEAD method
  2. 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;
    }
    
  3. 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?

like image 862
dausdashsan Avatar asked Oct 18 '25 10:10

dausdashsan


1 Answers

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

like image 135
Felipe Torres Avatar answered Oct 20 '25 01:10

Felipe Torres



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!