0

I'm creating a test suite for a test that should check that a specific API Service is available. So I'm confused on exactly how I can check the availability of a service. Is it sufficient to only check the status code to be 200 or are there other ways to confirm that?

1

It depends on how you define "available". Making a simple call and checking that you get a code 200 means the servers is up and it can recieve calls.

Now if the API uses for example a database then the simple call might not detect underlying systems are wrongly configured.

Personally I would want to ensure the API and its depencies are working. So doing a call that actually does something and verifying the result would make more sense. But you might not want to call API's that insert/change data.

I would suggest to ask the developers to add a HealthCheck method, that checks the internals of the API and gives a small json report to check.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.