spring-guides / gs-consuming-rest

Consuming a RESTful Web Service :: Learn how to retrieve web page data with Spring's RestTemplate.
https://spring.io/guides/gs/consuming-rest/
Apache License 2.0
195 stars 287 forks source link

Two questions #50

Closed janbman4 closed 3 years ago

janbman4 commented 3 years ago

Hello everyone,

I have completed the tutorial. However, two questions remain:

  1. Why does the application exposes a webservice on port 8080? I thought the application is a client that consumes an REST-API.
  2. What can the application do after the RESP-API's response is printed on the console? As far as I see, I cannot trigger to call the RESP-API again.

Thanks!

Jan

dsyer commented 3 years ago
  1. I guess it is both a client and a server then? Not so uncommon really. If you want to switch the web server off you can do it with a configuration property.

  2. Correct. It just prints the response once on startup.