Space Cadet
Space Cadet

Reputation: 403

Unknown Host Exception Yet Website Is Accessible

I'm using IntelliJ IDEA to implement the Spring Guide for consuming REST services

https://spring.io/guides/gs/consuming-rest/

When I run the Application class I receive the following error

Exception in thread "main" org.springframework.web.client.ResourceAccessException: 
I/O error on GET request for "https://gturnquist-quoters.cfapps.io/api/random": 
gturnquist-quoters.cfapps.io; 
nested exception is 
java.net.UnknownHostException: gturnquist-quoters.cfapps.io

The URL itself (https://gturnquist-quoters.cfapps.io/api/random) opens fine in a browser and my HTTP Proxy settings in IntelliJ can connect to the site without any issues. Why would an UnknownHostException be thrown here?

Upvotes: 0

Views: 3853

Answers (1)

sw3bst3r
sw3bst3r

Reputation: 11

Hey I know this is a bit late, but here is what I had to do to resolve this issue. Even if you are using system proxies, for whatever reason, using this type of GET request requires you to build out a proxy to use in the call, like so.

Example Image

Upvotes: 1

Related Questions