How to Send HTTP Request and Parse JSON Data Using Java

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

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

  • @samuelluswata
    @samuelluswata 5 ปีที่แล้ว +12

    This is the best explanation on TH-cam when it comes to the rest client. Thanks mate!!

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

    Thank you so much for this! This is the best tutorial I've seen thus far on youtube after all these years

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

    You made everything crystal clear..Thanks for the help

  • @offTheTable123
    @offTheTable123 4 ปีที่แล้ว +9

    This is a really high quality tutorial. I hope you keep making more of these in the future!

  • @MicahDanielSmith
    @MicahDanielSmith 5 ปีที่แล้ว +9

    Excellent reference. Especially appreciated the concept of showing 2 methods to accomplish the same thing. Thanks so much for putting this together. Keep building more tutorials. Subscribed!

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

    This is very helpful video. I searched lots of video about like that but i couldn’t. That’s why thanks a lot.

  • @25392633
    @25392633 4 ปีที่แล้ว +25

    Muito obrigado pela explicação, a melhor até agora!
    Thank you from Brazil!

  • @kuwertzel8938
    @kuwertzel8938 4 ปีที่แล้ว +10

    Regarding the time stamps in the description:
    If you put 0:00 as your first time stamp (eg. "0:00 - Introduction") the video timeline will get sections according to the timestamps. It's a neat little thing!

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

    incredible tutorial... best tutorial on java api and parsing json calling on youtube

  • @OlgaSkyba-b8z
    @OlgaSkyba-b8z 2 ปีที่แล้ว

    You have a very understandable and simple English and cool explaining ability! Thank you!!!

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

    Great video on demonstrating the Api, I couldn’t find any references for this on the web. Simply the best. Thank you and appreciate it!

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

    This video is everything I've spent hours looking for, thank you.

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

    Keep making more videos

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

    Thank you so much for making this video!

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

    the first method had me stuck and frustrated, I'm glad you included the second method. That worked. Seriously though, white background, and zoomed out so much that the text takes up maybe 1/3rd of the viewport... dark background, zoom in, word wrap.

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

    Thank you so much for this video. This has been by far the most helpful tutorial for someone who has no background in using APIs in java.

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

    Не знаю английский, но все понял. Крутой мужик, respect you!

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

    Excelente tutorial , gracias a ti acabo de aprender a consumir apis !

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

    Excellent explanation, organization and clarity! (I just had a hard time seeing the small print! But I did it!). Congratulations! (I'm from Brazil)

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

    Dude this is so amazingly helpful.

  • @GST-axelenandoh
    @GST-axelenandoh ปีที่แล้ว +2

    😍🔥

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

    you are literally a hero for this. The only thing that I was finding online was with APOD...thank you :D

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

    thank you so much sir for this amazing explanation this helped me tremendously hope you have a beautiful day

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

    AMAZING!!!! THANKS very much fandango!!!!!

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

    Incredibly helpful

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

    Thank you very much for this tutorial. I was searching for a way to do exactlythis in a simple way.

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

    Thank you, Sir, it works!
    I think this is one of many videos on the TH-cam--about parsing JSON with API--that works :D

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

    Excellent! Thanks for this.

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

    Super clearly Explained! Wow! Keep it up!

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

    Hello, i would to thank you so much for this simple tutorial. I've been looking for a few months in the internet for some tutorial like yours.

  • @Art-ub1sg
    @Art-ub1sg 5 ปีที่แล้ว

    Hey, dont stop. You make a great lessons!

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

    Excellent tutorial. Keep up the great work.

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

    Thanks a lot for the excellent explanation

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

    Ok man, this video is wonderfull, tkx so much

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

    Than you very much man! Very helpful tutorial.

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

    You are awesome!

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

    perfect/ thank you for such a great tutorial

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

    Thanks for this awesome tutorial 👍

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

    Thank you so much, incredibly useful tutorial, really helped me out.

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

    Thank you very much for this tutorial, I learnt a lot.

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

    but how to you get a usable output from the lambda method? Like an object array or something that you could manipulate further

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

    Very good tutorial!

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

    larger text would be better, as others have said, but the explanation was very good

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

    First method that you shown is showing json in single line can this be fixed to represent in actual json format

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

    Brilliant video, thank you. What is the best way to use multiple endpoints of an API without using a library?

  • @satmishra504
    @satmishra504 5 ปีที่แล้ว

    Excellent explaination ,thank you !!

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

    how can I make it so that the parse method returns an array or array list of the data that I want? I see that currently there is a String return type. If we did return a string, where would that go? How do I receive that in the main program?

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

    Super helpful! Thank you

  • @RohanHazara
    @RohanHazara 5 ปีที่แล้ว

    I like your explanation. great job!

  • @Tony.Nguyen137
    @Tony.Nguyen137 3 ปีที่แล้ว

    Thank you. 👍

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

    Thank you so much for this video . You clarified some thoughts that i had .

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

    Bro thanks a lot , u solved my problem

  • @lorence3290
    @lorence3290 5 ปีที่แล้ว

    such a great video, thank you so much helped tremendously

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

    Helpfull Video!

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

    is there a way to do it without the org.json dependencies

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

    Great tutorial! Thank you!

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

    Hey how you remember all this code what all had to be done ?

  • @isajamil4027
    @isajamil4027 5 ปีที่แล้ว

    Very Useful. Thanks.

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

    Thanks a ton man!

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

    Hi what about if I want to send a json to the WebService ?

  • @ByMyslf1
    @ByMyslf1 5 ปีที่แล้ว +3

    Thank you very much for helping me out! Maybe you should make the font size a little bit bigger, but otherwise great explanation!

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

    made it look so easy!!

  • @snowrida
    @snowrida 5 ปีที่แล้ว

    Awesome tutorial

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

    You are a lifesaver, thank you! Could you please show how to parse the data into an application and DB please! I am trying to get my parsed data into a TableView in a Javafx application

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

    good video, thank you

  • @Corqable
    @Corqable 5 ปีที่แล้ว

    Awesome video!

  • @minik4041
    @minik4041 5 ปีที่แล้ว

    Thanks so much for the video!

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

    So much thanks!

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

    What a great video this helps me a lot. And it would be better if you increased the size of the font.

  • @Unconvinient
    @Unconvinient 5 ปีที่แล้ว

    Thank you , Good explanation.

  • @padoization
    @padoization 5 ปีที่แล้ว

    Thanks for the video man!

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

    hi where can I place my API key in the code

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

    Ey man. How could I get an Object from other api, because alla the data in the api you use is Array.

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

    Do we have to create a new connection everytime our program wants to send GET request?

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

    nice video. thanks.
    while using java 11 how to set the http method to GET, POST, or PATCH and still get response from server.
    if you've any link to a documentation, it'll be usefull.
    Thank you

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

    How to call rest api using get method with query parameters

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

    It is awesome thank you so much

  • @nikhils.k7993
    @nikhils.k7993 4 ปีที่แล้ว

    what plugins are you using??
    and can anyone share the code!!
    would be really helpful if shared!!

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

    Hey. This video was useful to me. I also need to know how to send raw JSON object in the request body. Could you tell us how to do that?

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

    Thank you very very much

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

    what if the value of an ID is an array/list? I thought something like int[] test = testarray.getInt("test") would work but I'm not having any luck

  • @JuanRuiz-in1dg
    @JuanRuiz-in1dg 4 ปีที่แล้ว

    Nice job folk

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

    Do you use any plugins to use HTTPClient? I used Netbeans with jdk 12 but I can't use the http request of Java 11API

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

      dk if you resolved, but it's a NetBeans problem.
      stackoverflow.com/questions/53251708/make-the-new-jdk-11-java-net-http-package-visible-in-netbeans-10

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

    Love u hogya

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

    How Do I add request specification, token and type

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

    In my json instead of [ it is starting with { so it is getting an error. How to solve it?

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

    How do I pass in the api key to http request?

  • @АлександрПанин-щ2ь
    @АлександрПанин-щ2ь 3 ปีที่แล้ว

    лучшее объяснение!

  • @billyochab3299
    @billyochab3299 5 ปีที่แล้ว

    How would you be able to create a httprequest with different parameters that could be variables?

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

    Thank you so, bro

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

    How would you go about adding basic authentication to the second method?

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

      HttpRequest request = HttpRequest.newBuilder().uri(URI.create(url))
      .setHeader("Authorization", "Basic c2VydmljsdfdsfsdfZfdsf3sdkJDNLc25fsadaes")
      .setHeader("Accept", "application/json")
      .build();

  • @Robin-fg6jv
    @Robin-fg6jv 3 ปีที่แล้ว +1

    can I get the source code?

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

    Gracias muchas gracias >:,3

  • @josuedavidorantesescalante7668
    @josuedavidorantesescalante7668 5 ปีที่แล้ว

    Como estas hermano, hey necesito tu ayuda, A que libreria pertenece "MAIN" de la linea 67, en el minuto 26:23?

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

    Thank you. Finally no indian telling me how to use swagger and springboot.

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

    How we can send request with JAuth token

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

    Thanks

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

    pls attach the github link to the code
    i cant see the codes in the video

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

    Hey, I know this is late but what do you do when the JSON text starts with '{' instead of '['?

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

      If it starts with an '{' it is an object, so use JSONObject instead of JSONArray...

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

      Joshua Li JSONObject my_data = new JSONObject(responseBody);

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

    Why not just delcare the method as void? At 24:30
    Edit: Very good tutorial by the way!

    • @AlexSmith-pv5jc
      @AlexSmith-pv5jc 4 ปีที่แล้ว

      It works as void so might just have been a slip or something.

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

      anybody know how to receive the return of this method if we choose to return something? For example, he left it as string. What is I wanted to return a string instead of just print it, where would it go in the main program?