How To Retry HTTP Requests Using a Decorator in Python

Опубликовано: 29 Сентябрь 2021
на канале: John Watson Rooney
11,945
358

Failed requests to a server can cause us all sorts of issues, but rather than just handle the exception and log it away, retry it X amount of times using a retry decorator like this one.

I'll write and demo a retry decorator to show you how it works in principle, however if you are after something that is already written and perfected check out Retry-2 here: https://pypi.org/project/retry2/

the code in my example is here: https://github.com/jhnwr/retry-requests


Support Me:

Patreon:   / johnwatsonrooney   (NEW)
Amazon UK: https://amzn.to/2OYuMwo
Hosting: Digital Ocean: https://m.do.co/c/c7c90f161ff6
Gear Used: https://jhnwr.com/gear/ (NEW)

-------------------------------------
Disclaimer: These are affiliate links and as an Amazon Associate I earn from qualifying purchases
-------------------------------------


Смотрите видео How To Retry HTTP Requests Using a Decorator in Python онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал John Watson Rooney 29 Сентябрь 2021. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 11,945 раз и оно понравилось 358 посетителям.