HTTPX Tutorial - A next-generation HTTP client for Python

preview_player
Показать описание
In this Python Tutorial we learn about HTTPX, a modern HTTP client for Python with async support.

Resources:

Get my Free NumPy Handbook:

📓 ML Notebooks available on Patreon:

If you enjoyed this video, please subscribe to the channel:

~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

#Python

Timeline:
00:00 Introduction
00:47 Installation & Features
02:25 Basic Usage
03:55 Advanced Usage with Client
05:27 Async API
06:20 Web App Testing
07:33 Speed Tests

----------------------------------------------------------------------------------------------------------
* This is an affiliate link. By clicking on it you will not have any additional costs, instead you will support me and my project. Thank you so much for the support! 🙏
Рекомендации по теме
Комментарии
Автор

What's your favorite HTTP library in Python?

patloeber
Автор

This was brilliant, the more involved topic, the comparisons, discussing correct practices, everything! Keep it up!

TimL_
Автор

Thx Python Engineer for making High Quality Videos!

CppExpedition
Автор

I love Python! ... the simplicity of Pythonic ethos reverberates through even 3rd party Python modules

magno
Автор

🎯 Key Takeaways for quick navigation:

00:00 📖 Introduction to HTTPX
00:27 🚀 Getting Started with HTTPX
01:37 📜 HTTPX Features
02:58 🧪 Basic Functionality of HTTPX
04:05 🔧 Advanced Usage with HTTPX Client
05:27 ⚡ Asynchronous API in HTTPX
06:24 🧪 Testing Web Applications with HTTPX
07:33 🚀 Speed Comparisons
10:58 🎉 Conclusion

maqarg
Автор

It's funny I recently ran into domaintools switching from requests to httpx and didn't know why. Thanks for the run down!

theeox
Автор

Small nitpick, can you please use time.perf_counter() instead of time.time() since a lot of beginners watch your videos and it's the better function

anthonyaouad
Автор

Thankx for breaking it down.. great tutorial for beginners

uvle-tsbi
Автор

I used this in our project… best library for async and sync requests

Strikeviolet
Автор

Great content, looking forward for more.

ermalgashimramori
Автор

This is a great video that came at the right time! I was working with an API for the past week and the part of the pipeline that took the longest was the APi request through the requests library.

Now I'm going to implement this HTTTPX client and also try to work in the Async feature! Thank you! You're awesome!

daynetran
Автор

httpx is very good library. amazing asyncio support. at my job we have replaced all httprequests in our code base with this. we used aiohttp and requests in the past.

toosafelol
Автор

I was trying to use this, but you can't pass context to event handlers. This means, for instance, that a response handler only knows the response, but it has no knowledge of what the request was. Handlers are only assigned at the client level (no per-request handlers). So to get different handling for each request, you need a new client. This breaks connection pooling. Ultimately, I went with aiohttp, as it allows passing context per request. Hopefully they add this feature to httpx.

Zekei
Автор

Are there benefits compared to aiohttp? Performance should be comparable, but I'm curious if there is more... probably on testing flask / fastAPI as already mentioned?

michak.
Автор

Great video. In my experience with large project, its diffcult to use async in general because you dont have async support for lot of important libraries so you either have to mix blocking code with async or you need to re-implement a lot of stuff on your own in async..

Can you compare async against threadpool

JugaadTech
Автор

It would have been great if you verified that all the 150 Pokemon were successfully gathered after each time trial. We are just trusting that the outcome of the 0.57 second async gather is equivalent to the 7 second synchronous gathering of Pokemon details. I believe you, but I am skeptical and an extra 2 or 3 seconds in the video to print the contents of the lists after would have been appreciated! Thanks

Caedin
Автор

Any thoughts on whether additional code would be needed to handle a server's responses such as HTTP rate-limits?

vsniney
Автор

Hi, thanks for all useful info
Could you please make video list for your shorts videos

motaseamyousef
Автор

Great video thanks! Now is this also able to handle well in a multiprocess async fashion? I am looking into aiomultuprocess and not sure if it would be better to run this over aiohttp.

kosmonautofficial
Автор

have you tried http2 for making request ? what was the performance difference between http 1.1 vs 2 ? I think requests does not support h2 but httpx does.

tusharsnn