java.net.UnknownHostException error REST API
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One would get the error without connecting to internet otherwise. Do you see anything wrong with that?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Would you please answer?
Is the service running on you local machines (PC or laptop) ?
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
