Ask a Question

java.net.UnknownHostException error REST API

SOLVED
steventwerd
Occasional Contributor

java.net.UnknownHostException error REST API

Hi,

I'm using the open source (free) SaopUI and I am attempting to connect to the api: https://api.genderize.io

When I run the tests with internet connection it works fine but when I run without internet connection I get the error: java.net.UnknownHostException.

I've been told that APIs shouldn't be affected by internet access, I am relatively new to REST APIs so can someone confirm whether internet access is required for REST APIs and if so why my test isn't working when I turn my internet off?

Thanks

 

 

5 REPLIES 5
nmrao
Community Hero

Is the service running on you local machines (PC or laptop)?

One would get the error without connecting to internet otherwise. Do you see anything wrong with that?


Regards,
Rao.
steventwerd
Occasional Contributor

When you say service do you mean the genderize api endpoint?

 

Also could you provide an example of when it would be possible to use a REST API without internet?

Would you please answer?

Is the service running on you local machines (PC or laptop) ?



Regards,
Rao.
steventwerd
Occasional Contributor

I did ask what you meant by service, if you are talking about the genderize api endpoint than no I don't think it is running locally on my laptop/pc.

Thanks.
If you are making a rest call to this (https://api.genderize.io) endpoint then it may not be possible to access without internet.

Not sure what you are trying to achieve.
You may run a mockservice as explained below video (you may not need internet )
https://www.youtube.com/watch?v=L2SMZ9bbDvE

Here you can find the required info
https://stackoverflow.com/questions/30580562/what-is-the-difference-between-resource-and-endpoint


Regards,
Rao.
cancel
Showing results for 
Search instead for 
Did you mean: