Spring Boot call REST API Tutorial

Поділитися
Вставка
  • Опубліковано 15 лис 2024

КОМЕНТАРІ • 63

  • @Daniel-Murphy951
    @Daniel-Murphy951 8 місяців тому +2

    Dude legit saved my career! Wish they taught us this stuff in college lol! Though you gotta be on top your game lol. He goes fast!

  • @priteshsingh299
    @priteshsingh299 Рік тому +1

    Love from Nepal.

    • @DanVega
      @DanVega  Рік тому +1

      Thank you for the support in Nepal. 🙏

  • @kaatlev
    @kaatlev 2 роки тому +5

    love the real world examples these are so helpful

    • @DanVega
      @DanVega  2 роки тому

      Thank you so much. Glad these videos are helping 🤩

  • @ds866
    @ds866 2 роки тому +1

    Thank you so much Dan, for creating a video based on my question to you, hopefully it can be help someone else who feel the same situation 😇😇

  • @nicolasbriand9114
    @nicolasbriand9114 Рік тому +2

    Hi, thank you for the time and the content, as the content is pretty recent, is there a reason you did not use WebClient over RestTemplate ?

    • @DanVega
      @DanVega  Рік тому +2

      I'm in a MVC application which is blocking so RestTemplate works fine. If you're in reactive application I would reach for WebClient.

  • @andyl.5998
    @andyl.5998 Рік тому +2

    It'd really great to have a tutorial on jackson, as mentioned at 11:25.

  • @tohidfla
    @tohidfla 2 роки тому +3

    Great content. as another sequence video can you please add a queue to this two service so one can put todos in queue and other one picking it up whenever ready. that would be a good idea

  • @murunatan6661
    @murunatan6661 2 роки тому +2

    Excellent one. Just one suggestion regarding the H2 DB please suggest the Dialect or mode. Beginners will stuck if that part is giving Runtime errors.

    • @DanVega
      @DanVega  2 роки тому +2

      What errors are you getting? I don't change any dialect for the h2 embedded db.

    • @murunatan6661
      @murunatan6661 2 роки тому +1

      @@DanVega Yes, you are correct, in mem h2 db it works fine. It is my bad I had a local h2 with a different dialect caused an issue for me. False flag sorry.

  • @manojpal8337
    @manojpal8337 7 місяців тому

    Hello , Thank you for the Explanation , Please keep continuing the same , Love the way you code. I am getting 401 Unauthorised: [no body] Error while calling external rest points. Do you have any suggestion ?

  • @victorbear4904
    @victorbear4904 Рік тому

    Hi Dan , could you please make some videos about spring cloud and micro services,thanks

  • @derda1304
    @derda1304 Рік тому

    Thank you for your work
    great tutorial, still works in Spring Boot 3
    greetings from Vienna :D thanks for this lecture :D
    if you want a suggestion for a new video: Security in SpringBoot3 doesn't have much educational content online right now (well haven't looked really thoroughly right now, but i will need it in the future)

  • @paulfx5019
    @paulfx5019 Рік тому

    Great tutorial. What be more real word like is to add security dependency to both services, with the Dashboard service using form base security and API using token base security and finally Todo service using token base security only. Maybe a part 2 tutorial?

  • @koushiksinha4822
    @koushiksinha4822 2 роки тому +2

    Would be great if you create a video on consuming 3rd party API with live authentication using webclient, and explain little bit under the hood concept..like the jackson one you mentioned....Cheers :)

    • @DanVega
      @DanVega  2 роки тому +1

      Sounds like a great suggestion. I will see if I can find a good public API that needs auth to use.

  •  2 роки тому +1

    As usual Dan, superb work! Just the question that follows, how to deal with token authentication to service and chaching, alternatives Thanks!!!

    • @DanVega
      @DanVega  2 роки тому +2

      I have a video on using JWTs for authentication. What exactly are you looking to do so I can be sure of your question.

    •  2 роки тому

      @@DanVega I am looking for Bearer Authentication, how to add the token in the header of the request. I am looking also about the way to filter and map a complex json collection. Thank you Dan!!!

  • @alessandrodemanzano3527
    @alessandrodemanzano3527 2 роки тому +2

    very interesting, thanks ! What about a video about the old-but-still-used-sigh SOAP services ? maybe something about creating both server and client SOAP services starting from WSDL and XSD provided files.. ;-) thanks anyway!

    • @DanVega
      @DanVega  2 роки тому +2

      I honestly haven't done work with SOAP in years. Sorry 🤦‍♂️

    • @alessandrodemanzano3527
      @alessandrodemanzano3527 2 роки тому +1

      @@DanVega hehe, unfortunately some State-based service here in Italy still use it.. thanks anyway!

  • @ruslansimakov9087
    @ruslansimakov9087 2 роки тому +2

    Copypasting Model-class to each services produce inconsistency (one place we changing, for another place - we forgetting).
    What is the best way to avoid DRY?

    • @DanVega
      @DanVega  2 роки тому +1

      In a distributed architecture you are going to have some duplicated code and it's just part of the trade-off. A lot of the time it isn't a straight copy where a Model might be represented one way in service A and another in service B. When I think of DRY I think about it in the same system, not 2 different systems.

  • @seyhaphan7319
    @seyhaphan7319 Рік тому

    Very useful, Thanks a lot. Dan, how about spring framework 6: http inteface in production

  • @jeevanthalluri2200
    @jeevanthalluri2200 2 роки тому +1

    Please upload one e commerce project with dashboard with springboot security jdbc + react hooks

  • @mrooglyboogie4118
    @mrooglyboogie4118 Рік тому

    Hello, I am trying to call a third-party API, but it requires authentication (bearer token) to get the data, how do I proceed from what you showed in this video?

  • @rdothl5
    @rdothl5 Рік тому

    You the man, thanks for this.

  • @djgavrilove
    @djgavrilove 2 роки тому +1

    Very useful, thanks a lot. Dan, one more things to clarify: in order to avoid hard coded binding directly to localhost:8080 and localhost:8081 should we use Open feign Client, am I correct ? Are there other alternatives? How often in production is RestTemplate used? Thanks again.)

    • @ruslansimakov9087
      @ruslansimakov9087 2 роки тому +2

      As of Spring Framework 5, alongside the WebFlux stack, Spring introduced a new HTTP client called WebClient. RestTemplate would be deprecated

    • @djgavrilove
      @djgavrilove 2 роки тому

      @@ruslansimakov9087 thanks

    • @DanVega
      @DanVega  2 роки тому +4

      That's not true. RestTemplate is feature complete, not deprecated. I still reach for RestTemplate in my Spring MVC applications.

    • @DanVega
      @DanVega  2 роки тому +4

      You are correct that you don't want to hard code URLs + ports because those can change. In a distributed architecture you would use something like service discovery and avoid hard coding URLs.

    • @djgavrilove
      @djgavrilove 2 роки тому

      @@DanVega thanks

  • @marciosantos941
    @marciosantos941 Рік тому

    Excelent content! Thank you so much.

  • @袁潤江
    @袁潤江 2 місяці тому

    Why are configurations like connection request timeout, connect timeout and read timeout as well as http header not set for the POST request?

  • @alexbrun6863
    @alexbrun6863 Рік тому

    nice tutorial subscribed :)

  • @OmarMendozaKS
    @OmarMendozaKS 2 роки тому

    Hi Dan, thanks for all the help you provide, always clear and helpful, is it possible for you to shed some light on what free alternatives to Heroku hosting you recommend (java deploy, JIC)?

    • @DanVega
      @DanVega  2 роки тому +1

      I'm working on putting this list together now... I don't know if you're going to find a lot of free options but railway.app has a great free tier for at least getting something started.

    • @OmarMendozaKS
      @OmarMendozaKS 2 роки тому

      @@DanVega thanks for reading

  • @nurhadi-dev
    @nurhadi-dev 2 роки тому

    thank you sir. as always,, great content n very useful.

  • @Marnee4191
    @Marnee4191 Рік тому +1

    I really appreciate your videos. I have some suggestions to make them easier to consume. First, please make your audio louder. It's always too quiet. Also, please don't start from scratch in every video. Prepare the services and DB records in advance. We don't need to see that every time.

    • @SaifulIslam-fo1bt
      @SaifulIslam-fo1bt Рік тому +1

      Everyone not pro like you bro..

    • @Marnee4191
      @Marnee4191 Рік тому

      @@SaifulIslam-fo1bt That has nothing to do with it. There should be one video with the basics of creating a non-production Spring Boot app, which he could link to in each of his other videos. He doesn't need to repeat that in every single video, making them longer than they need to be and making it more difficult to know when the actual tutorial starts.

  • @leong5940
    @leong5940 10 місяців тому

    can you show how to get response body when api don't return 200 status?

  • @ashishsengar87
    @ashishsengar87 2 роки тому +1

    In app I am using the rest template to post and get but rest template throws exception when status is not 200. So the line for checking status does not get executed.

    • @DanVega
      @DanVega  2 роки тому

      What exceptions are being thrown?

  • @Lauchilus
    @Lauchilus Рік тому

    great content!!

  • @abdulrhmanbashammakh7006
    @abdulrhmanbashammakh7006 Рік тому

    Thanks

  • @amritadhikari1188
    @amritadhikari1188 Рік тому

    Awesome

  • @dekeyserwilly
    @dekeyserwilly 2 роки тому

    Great 👍👍

  • @kreativcity
    @kreativcity 2 роки тому

  • @jopadjr
    @jopadjr 2 роки тому

    33rd...Thanks Dan

  • @ConvierteteAJesúsAhora
    @ConvierteteAJesúsAhora 2 роки тому +1

    If you were pronouncing more clearly for non-natives as me :(

    • @DanVega
      @DanVega  Рік тому +1

      I'm sorry I thought I was pretty clear. I will make an effort to do better in the next video.

  • @RoselysDiaz-e9u
    @RoselysDiaz-e9u Рік тому

    very confusing video

  • @gordanainic2766
    @gordanainic2766 2 роки тому +1

    Thank you so mach for so great! I I get little issue . In the Method commandLinkeRunner i have problem that TodoServiceApplication required a bean of type 'dev.goca.todoservice.repository.ToDoRepository' that could not be found. Can sambedy please help with that?... Thank you so mach!

    • @DanVega
      @DanVega  2 роки тому +1

      Did you add it as an argument to the commandLineRunner method?