Spring ResponseEntity - How to customize the response in Spring Boot

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ม.ค. 2025

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

  • @ErmanAvsar
    @ErmanAvsar 10 หลายเดือนก่อน +3

    Great video, some feedbacks are for you Dan -> it would be nice about talking exception handling case. When exception handling occurs, we can change the response headers accordingly so it can be better to use it. Other feedback is, it is always good to have some chapter markers; intro, problem definition example, etc..

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

    Thumbs up was given at the earliest occasion - Dan, subscribed long time ago, got really the values :) Thank you for sharing the knowledge in your own unique style!!

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

    This Type Video Tutorial is veru helpful THANKS
    ALSO make video on best practicse in spring boot

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

      Thank you so much for the kind words!

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

      One tip: there is a short list of recommendations if you search for spring best practices openrewrite

  • @kostiantynkarzhanov9216
    @kostiantynkarzhanov9216 11 หลายเดือนก่อน

    Thank you so much! Very well explained! 💛

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

    Wheww you have clear my confusion on this topic , Kudos :)

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

    Nice contents . Pls dont stop to post videos Dan Vega

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

    In our project, we use ResponseEntity because there is an exception handler that alters the HTTP response code (400, 500 etc...) and the error body is a uniform and known object with standard error codes and descriptions

    • @DemirYumrukk
      @DemirYumrukk 10 หลายเดือนก่อน

      now that makes sense

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

    I was finally able to understand what ResponseEntity is with your video. Thank you. By the way what theme are you using here for intellij?

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

    Can you also return a ResponseEntity if you're using GrahphQL instead of REST?

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

    I really want your bash prompt setup please. The PS1 value!!

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

    Dan what's your terminal setup? it looks awesome 👌

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

    Could you please mention some use cases when we would want to add custom headers? Sorry if the question is stupid, I just landed my first job as a Junior 1 month ago, im kinda new.

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

    Hi Dan, how can I create response with some field in a object a request with some fields

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

    thanks for awesome video,how do we create api for multipart data,form data with multiple text and multiple images, what is the best way and configuration to store images, also how do we do that in server as well?

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

    Any thoughts on using this responseEntity for exception handling ? Even though the response might not contain headers but there is still a possibility that down the line it could run into some exception ? And as always thanks for the informative vids keep it up

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

      Thank you for watching and great question! When I think about exceptions these are scenarios where things went wrong. In that case I am sending the appropriate error code along with a the response details. Was something not found, send a 404. Was this a bad request, send a 400. There is also a new problem details implementation in Spring Boot 3 that lets you send more details in the error response for APIs.

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

    @Dan thanks for examples, would it be a good/bad practise to wrap response alway in a Map.of("data", anyypojo") any performace impact?

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

    how do you start server that fast sir ??

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

    Good One, Thanks

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

    which IDE areyou using ?

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

      It's the new version of IntelliJ, which has a new UI

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

      @@jaysizmir9432 what is the ui called?

  • @AhmedAli-jx9ie
    @AhmedAli-jx9ie 2 ปีที่แล้ว

    what theme do you use?

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

    Hi, can i ask you a question, i wanna be using kotlin spring boot for production and realword app, can i have a any issue in future ? Or Spring boot is a good for all solutions java ?

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

      I do not have any applications written in kotlin but spring has supported it for several years and I don't remember hearing any reports of production issues. Do you have any particular concerns?

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

    Which Theme or color scheme you are using

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

      This is New UI that available from EAP or latest updates.
      You can enable it by going to Settings -> Appearance & Behaviour -> New UI -> Enable New UI

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

      @@intBRiNGER Yes I know that is new UI but on top of that the editor colors and and for is not from intellij, so I am asking this.

  • @JaphethAwah
    @JaphethAwah 11 หลายเดือนก่อน +1

    how is he calling his API from the commandline, someone please save me.

    • @DanVega
      @DanVega  11 หลายเดือนก่อน

      You can call it using curl but i find httpie httpie.io/ to be a bit more user friendly

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

    What's up Dan ?

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

      Doing great, how about you?

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

      @@DanVega Doing great, i have 3 weeks of holidays starting today. Thank you for all the content, see you on the next Spring Office Hours episode

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

    106th...Thanks Dan

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

    4:36 There is no reason "/" inside @GetMapping()