How to consume external RestAPI in Springboot using RestTemplate

Поделиться
HTML-код
  • Опубликовано: 24 янв 2025

Комментарии • 19

  • @TusharBirole
    @TusharBirole Год назад

    Hey thanks a lot I have one question I am new to java I understood the flow but can you please tell me what is the use of lambda operator here and reference type and why you used get(0) index.
    Thanks you once again.

  • @nenuanenenuane6645
    @nenuanenenuane6645 Год назад

    great love it

  • @Rk_itz_me
    @Rk_itz_me 6 месяцев назад

    Can you do for postforentity ?

  • @suruchigupta6639
    @suruchigupta6639 Год назад

    When I'm hitting rest api in postman it's showing json data but in my application it's passing null values.. i did double check var names in pojo class all are correct

    • @codercommune
      @codercommune  Год назад

      Can you be more specific? Or share the result output?

    • @codercommune
      @codercommune  Год назад

      You can share more details on gram @codercummune

    • @suruchigupta6639
      @suruchigupta6639 Год назад

      Actually i'm using alpha vantage api, and I wasnot aware about maximum api request limit so before crossing the limit when i was calling api it was working perfectly fine but after over limit even post was showing null value with limit over info. and status was 200ok
      after 24 hrs I tried again in postman json data was now visible but in my web app it was still showing null result.
      I tried with different api keys it was working with postman but not in my application
      there was not error throwing in my app it was running fine just values not showing up
      I tried invalidate caches>> invalidate restart
      rebuilt still didnt work idk why new data is not showing up

  • @shivanrai
    @shivanrai Год назад

    Gazab consuming

  • @KuchBhi24211
    @KuchBhi24211 8 месяцев назад +1

    all this objectMapper, RestTemplate builder and stream operation should be implemented in Service package instead of Controller .

  • @shivanrai
    @shivanrai 2 года назад +1

    👌👌

  • @kumarabhishek1064
    @kumarabhishek1064 2 года назад +2

    Can you explain what DataResponse & ObjectMapper class is doing in ur code?

    • @codercommune
      @codercommune  2 года назад +1

      Hi Abhishek,
      Thanks for asking the query.
      DataResponse is the POJO class which was created for storing the Object from JSON data.
      ObjectMapper is for mapping the JSON data to POJO class.
      I hope i have clarified your doubt.
      Regards,
      CoderCommune

    • @kumarabhishek1064
      @kumarabhishek1064 2 года назад +2

      @@codercommune
      Ah! Got it.
      Good work bro 👍

    • @codercommune
      @codercommune  2 года назад

      Thanks for the feedback ❤️

  • @abdulrhmanbashammakh7006
    @abdulrhmanbashammakh7006 Год назад

    Perfect

  • @seemabangar1611
    @seemabangar1611 Год назад

    Hi, I have tried this approach but I am getting com.fasterxml.jackson.databind.exc.MismatchedInputException .

    • @suruchigupta6639
      @suruchigupta6639 Год назад

      try to double check pojo class variables are they same as vars in json / xml data of api