0

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?

Space Cadet
  • 385
  • 6
  • 23

1 Answers1

1

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

sw3bst3r
  • 11
  • 2
  • Welcome to stackoverflow, please edit your answer by adding a code sample and please take a look at this article : https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-on-so-when-asking-a-question/285557#285557 – Fourat Sep 09 '19 at 15:32