How to Consume REST APIs in Spring Boot - 2 Methods (RestTemplate and Feign Client)

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ต.ค. 2024

ความคิดเห็น • 76

  • @samjuthecoder2310
    @samjuthecoder2310 3 ปีที่แล้ว +2

    Thank you bro! This simple tutorial has solve my problem. You are really a teacher. wow VERY SIMPLE AND EASY explanation

    • @KindsonTheTechPro
      @KindsonTheTechPro  3 ปีที่แล้ว +1

      My pleasure!! And do remember to subscribe 😃

  • @yogie4u1
    @yogie4u1 2 ปีที่แล้ว +3

    Simple and explained very well... I am trying to get something done similar but in my case before calling the actual endpoint I need to get authentication token and use it in subsequent request. The token has a expiry time and have to be stored and reused. Can you please explain how can save it and use.
    Thanks

  • @tobiillz
    @tobiillz ปีที่แล้ว

    You're a very good teacher. Kudos

  • @deepakbodkhe1492
    @deepakbodkhe1492 2 ปีที่แล้ว

    Thanks for this tutorial. You have resolved my problem.

  • @priyankarawat4237
    @priyankarawat4237 2 ปีที่แล้ว +2

    Explained beautifully. Thanks alot!

  • @vikashcsenitjsr
    @vikashcsenitjsr 2 ปีที่แล้ว +2

    Thanks for awesome explanation 😊😊

  • @emmarichardson4743
    @emmarichardson4743 3 ปีที่แล้ว +1

    This is broken down so well. Thank you!

  • @fikirwalle843
    @fikirwalle843 4 ปีที่แล้ว +1

    i really appreciate your support

  • @mesarfarazalam3979
    @mesarfarazalam3979 2 ปีที่แล้ว +1

    Thnku for this wonderful video. I request you to please make videos on microservices..

    • @KindsonTheTechPro
      @KindsonTheTechPro  2 ปีที่แล้ว

      I made 3 Tutorial series on Microservices:
      1. bit.ly/3LN249R
      2. th-cam.com/video/Gw1rqRH0aLY/w-d-xo.html
      3. th-cam.com/video/s-SISehUOPw/w-d-xo.html

  • @pranoydas4068
    @pranoydas4068 3 หลายเดือนก่อน +1

    Sir, can you make a video for POST method using restTemplate? U just pass some headers and requestBody and take the response as an Object(because u don’t know what is the response structure) How can we do that ?

  • @chmulato
    @chmulato 3 ปีที่แล้ว +1

    Great explanation Kindson!

  • @GabrielRibeiroData
    @GabrielRibeiroData 4 ปีที่แล้ว +3

    Thank you man! Nice work.

  • @juancespedes2199
    @juancespedes2199 3 ปีที่แล้ว +1

    Great video, thanks Kindson!!

  • @GLpietro14
    @GLpietro14 3 ปีที่แล้ว +1

    Great video Kindson!

  • @arpanbanejee5143
    @arpanbanejee5143 3 ปีที่แล้ว +2

    Thanks for the awesome explanation,can you pls provide the github repo link, so that we can set it up
    in local

  • @pranoydas9654
    @pranoydas9654 2 ปีที่แล้ว

    Excellent video

  • @andremyszko
    @andremyszko 3 ปีที่แล้ว

    thanks very much Kindson! very rich infos here, heavy! i am learning spring boot with vscode, trying to make an external call

  • @lopezpleonel
    @lopezpleonel 3 ปีที่แล้ว

    You are the best. Thanks a lot for the explanation.

  • @bayomiller3415
    @bayomiller3415 2 ปีที่แล้ว +1

    This was just the tutorial I was looking for! Thanks for making it available.
    Do you have a video or could you give me a hint on how to go about the task.
    If the site at which you are trying to consume data from is not static, for instance : weather. And then i have to consume data from this site at an interval, every 3hrs for instance and save it to the database

    • @KindsonTheTechPro
      @KindsonTheTechPro  2 ปีที่แล้ว +3

      This is an interesting point...I'll make a video on this in comming days. Do subcribe to get notified

    • @bayomiller3415
      @bayomiller3415 2 ปีที่แล้ว

      @@KindsonTheTechPro yes, i get notified. Unfortunately for me, i have to give in the task in 2days, and I'm still having troubles solving it

  • @chandanpatel6528
    @chandanpatel6528 3 ปีที่แล้ว +1

    Thanks for explanation

  • @christopherjohnhispano5665
    @christopherjohnhispano5665 3 ปีที่แล้ว +1

    Great video! Would this implementation be applicable if the external API requires username and password?

    • @KindsonTheTechPro
      @KindsonTheTechPro  3 ปีที่แล้ว

      Yes... but you then the request must be authenticated

  • @pranoydas9654
    @pranoydas9654 2 ปีที่แล้ว +1

    Hello Sir,
    Can you please make a video series of Quarkus in Java ?
    Can you please make a video to read a excel file using Quarkus and produce JSON object and send to another service ?

  • @tas5704
    @tas5704 3 ปีที่แล้ว +2

    Thank you. However, please follow naming conventions of Java interface.

  • @daumtto
    @daumtto 7 หลายเดือนก่อน +1

    You good. Thank you sir.

  • @koneruReddys
    @koneruReddys 2 ปีที่แล้ว

    nice explanation sir

  • @tolulopeayemobola1446
    @tolulopeayemobola1446 3 ปีที่แล้ว

    Hi .. Thanks for your very amazing videos; this inclusive.
    I have a few questions, can I ask please?

  • @krthck3
    @krthck3 4 ปีที่แล้ว

    Very well explained. Thank you.

  • @maruthimanjappa
    @maruthimanjappa 3 ปีที่แล้ว +1

    Thank you so much

  • @emilioastier
    @emilioastier 2 ปีที่แล้ว +1

    thank you

  • @mubarakdesh4442
    @mubarakdesh4442 4 ปีที่แล้ว +1

    Thank you for this video

  • @Ravikumar-gj6qw
    @Ravikumar-gj6qw 2 ปีที่แล้ว

    Hi Kindson, what if i add @enablefeignclient annotation on springbootapplication level ?

  • @heliocavadissa6366
    @heliocavadissa6366 2 ปีที่แล้ว

    How come you didnt have any certificated related problems, since you are using https?

  • @camillefrazao7823
    @camillefrazao7823 4 ปีที่แล้ว +1

    Thank you for the video!
    very simple and efficient. Perfect!

  • @chekerrhayem3594
    @chekerrhayem3594 2 ปีที่แล้ว

    thank you , but : how to consume data from CSV file instead of data from api( i mean how to consume data from csv file on my PC in order to obtain a JSON file as a result)

  • @soulfulGirl_
    @soulfulGirl_ 3 ปีที่แล้ว

    When to use rest template and feign ?
    What's the difference btw them apart from length of code

  • @ritikagargjagtap7794
    @ritikagargjagtap7794 2 ปีที่แล้ว

    can you plzz make a video on how to consume an https rest API with SSL cert??

  • @yazeezy4425
    @yazeezy4425 ปีที่แล้ว

    I get a 500 status when using restTemplate. Code is exactly the same... What can I do to solve?

  • @karemherrera4367
    @karemherrera4367 3 ปีที่แล้ว +4

    ¿What did you put on minute 9:45?

  • @asliddin2012
    @asliddin2012 3 ปีที่แล้ว

    very, very helpful

  • @Romigo4
    @Romigo4 4 ปีที่แล้ว

    Thank you for the video !
    Couple of comments:
    1. I always thought that IDEA autosaves evething we code ? why do you use "Save all" ?
    2. As for me I don't like when IDEA underlines something, so when you use @Autowired, and you have next string underlined, one could use Lombok annotation @RequiredArgsConstructor and code next: private final RestTemplate restTemplate;

    • @g-l8492
      @g-l8492 3 ปีที่แล้ว

      IntelliJ auto saves only when you activate autosaving (somewhere in the settings). He has not turned on auto saving.

  • @tolulopeayemobola1446
    @tolulopeayemobola1446 3 ปีที่แล้ว +1

    When I try to add the ribbon dependency from Intellij and from start.spring.io,
    I am unable to because it says ribbon [maintenance] is not available.
    And when I run the project, after following all that you say,
    it gives me an error
    Would you like to see the code?

    • @smyhail
      @smyhail 3 ปีที่แล้ว +1

      I gad his problem too. it was enough to add

      org.springframework.cloud
      spring-cloud-starter-netflix-ribbon
      2.2.1.RELEASE

    • @sebasjm4442
      @sebasjm4442 2 ปีที่แล้ว

      @@smyhail Thanks!! :D

  • @yohanaf
    @yohanaf 2 ปีที่แล้ว

    In the first example, how can I return just some of JSON proprieties? Example: I just wanna know the countrie's name and flag.

    • @walidkhelil4324
      @walidkhelil4324 2 ปีที่แล้ว +1

      apiCountries.getCountries(index).getName or getFlag ....

  • @sasanksharma8396
    @sasanksharma8396 4 ปีที่แล้ว

    On point Thanks Mate......

  • @danieljacobo8874
    @danieljacobo8874 4 ปีที่แล้ว

    Thank u master

  • @minakshichoudhary2110
    @minakshichoudhary2110 4 ปีที่แล้ว

    How can I pass Optional in rest template exchange or feigh client as the return type of method is Optional

  • @abhiteshkumarmishra9569
    @abhiteshkumarmishra9569 2 ปีที่แล้ว

    Could you please share the git hub code repository?

  • @kelennafavour9898
    @kelennafavour9898 2 ปีที่แล้ว

    please do for post request

    • @walidkhelil4324
      @walidkhelil4324 2 ปีที่แล้ว

      var restTemplate = new RestTemplate();
      String url = URL_CREATE_COUNTRY;
      var uri = new URI(url);
      HttpHeaders headers = new HttpHeaders();
      headers.setContentType(MediaType.APPLICATION_JSON);
      ObjectMapper objectMapper = new ObjectMapper();
      var json = objectMapper.writeValueAsString(Country);
      HttpEntity request = new HttpEntity(json, headers);
      restTemplate.postForEntity(uri, request, String.class);

  • @par28011
    @par28011 3 ปีที่แล้ว +1

    This vidio appears to be good but I cant see very well what you write