Dealing with WebAPI Slow or No Response

I was curious how other are handling Web API calls that are slow or never respond. I run a waiting look, then return an error that LOOKS like the API service error.


EDIT: This API is acutally pretty fast. This is just an example of how I have been handling API calls in general.

What other approaches are others using?

1 Like

I would use a different service if and when possible should I experience issues like that. Have you checked out googles timesone api? It’s only a 400 ms avg response time.

Obviously this doesn’t solve all situations. Your solution looks pretty solid IMO.

https://maps.googleapis.com/maps/api/timezone/json?location=38.908133,-77.047119&timestamp=1458000000&key=AIzaSyB7Ge0aDj6A9KR6Gi81Pz-HkDzWwvjaA-w

{
   "dstOffset" : 3600,
   "rawOffset" : -18000,
   "status" : "OK",
   "timeZoneId" : "America/New_York",
   "timeZoneName" : "Eastern Daylight Time"
}

@nradjt74jatz,
Thanks for the tip! This API is actually extremely fast and reliable. I have a few others that are less so.