How To Call An API in C# - Examples, Best Practices, Memory Management, and Pitfalls

preview_player
Показать описание
It seems like everything has an API these days but have you ever wondered how to make use of an API in your application? It turns out that it isn't really that hard at all. In this video, I am going to show you how to easily load the data from two different APIs into an application. Along the way, I will show you how to avoid some memory issues and other best practices around talking to APIs

0:00 - Intro
1:00 - Demo application walk-through
6:02 - Setting up API calling: HttpClient
13:48 - Setting up API calling: API calls
19:14 - Setting up API calling: Reading and working with json data
28:18 - Loading image in WPF (form a website)
35:29 - Adding events in WPF application: wiring up action buttons
39:40 - Note on information Cashing
42:55 - Sunrise-sunset API: Nested json objects, API calls, WPF events, displaying information
51:56 - Loading other WPF forms from MainWindow
53:38 - Summary and concluding remarks

Chapter breakdown by Ralfs HBK
Рекомендации по теме
Комментарии
Автор

Still churning out new videos and immediately responding to comments from 3-year old videos :-) You're a credit to the community! Thanks for the videos and keep up the good work.

craigmcloughlin
Автор

I have watched a few videos about calling API's. And I originally skipped this one because of the length, and I was so anxious to get started. After taking the time to watch it, I regret skipping over it. This video was so informative, and Tim really has a way of explaining everything very thoroughly. I am now a fan, and will be watching as many of your videos as possible. Thank you for taking the time to create these videos.

nogo
Автор

As a newbie to coding in general i appreciate the advice on the comic model. Just specifying the properties you need is golden nuggets. I’m always like ‘give me all the things magical internet box’ and I’ll figure out what I need, whilst my program grinds to a halt. Thank you Tim Corey for knowing what I need before I do.

beerguy
Автор

I just started my first ever api project at work. This video really saved me. Very clear. Tremendously helpful.

chellyengert
Автор

Luckily I found this video. You're the only one who can describe these techniques in an organized way. I just subscribed to your channel too.

RickGtr
Автор

I wish I could "like" this video more than once. You are a great teacher.

hachadwick
Автор

I've been confused about API and integrating with C#, watched various videos about this subject and was still lost, your explanation has made it more clear. Thanks for your tutorials - looking forward to the continued courses.

DameLyf
Автор

I wondered how to connect to a web API for a long time. I sought out for the resolution for a long time and I couldn't understand anything until I've watched this video. Thank you a lot, sir.

romedov
Автор

Great video, one of the best on YouTube when it comes to C#

milanstraka
Автор

Thank you, Tim for pouring down all the information ( as much as you could ) from your heart and not holding anything back!!!!
I'm feeling lucky to got stumbled upon this video amongst plethora of content out there!!!! Looking forward to learn new things about programming/coding/web development!! THANK YOU SIR!

shubhamsahrawat
Автор

0:00 - Intro
1:00 - Demo application walk-through
4:09 - Setting up API calling: WebApi.Client and Newtonsoft.json NuGet references
6:02 - Setting up API calling: HttpClient
13:48 - Setting up API calling: API calls
19:14 - Setting up API calling: Reading and working with json data
28:18 - Loading image in WPF (form a website)
35:29 - Adding events in WPF application: wiring up action buttons
39:40 - Note on information Cashing
42:55 - Sunrise-sunset API: Nested json objects, API calls, WPF events, displaying information
51:56 - Loading other WPF forms from MainWindow
53:38 - Summary and concluding remarks

RalfsBalodis
Автор

I am probably a crappy starting up programmer who rarely subscribes to channels and rarely ever likes videos. For you I make an exception, this video was super helpful and this kind of content is rarely ever free. Thank you and God Bless the beard.

EliminateMundane
Автор

That's an amazing and hard to find sort of tutorial on youtube, thank you!

alilubab
Автор

Great Video Tim, I always wait for your new videos, can you make a video on Serialization and Deserialization, Thanks

RAM-ffdy
Автор

I just got an assignment for a job where I had to do exactly this and it helped me alot. Thank you!

CRBarchager
Автор

Thank you! I really appreciate how you have given back to the c# community.

patrickbacon
Автор

I don’t really comment often but I just want to say thank you so much. You have been a really big help on a side project I’m working on and you explained everything so well!

alexanderrupp
Автор

Thanks Tim, these concepts helped me in an interview

madhusaivemulamada
Автор

Did this in generics because of knowledge from your other video about generics. Thank you, always happy to take a challenge when you suggest something extra.

filipzeman
Автор

Thank you Sir. Can you please do a video on serialization and deserialization in C# may be considering a wpf datagrid serialized into XML. I found
many examples, but when you explain it will be complete for sure

vinuhosanagar