Как я могу решить проблему получения ошибки HTTPSConnectionPool «Максимальное количество повторов превышено с URL-адресоPython

Программы на Python
Ответить Пред. темаСлед. тема
Гость
 Как я могу решить проблему получения ошибки HTTPSConnectionPool «Максимальное количество повторов превышено с URL-адресо

Сообщение Гость »


As the title states, I continue to get this error and I have tried using a request Session object to then mount an adapter with a max retries option. Apparently it is still exceeding the retries, and I thought adding the adapter with a backoff factor would help the issue. Here is a code snippet of how I am doing this:

Does anyone see anything I am doing wrong in adding this session adapter or is there a fix that works better for this problem?

This is what I am trying currently:

session = requests.Session() retry = Retry(total=3, backoff_factor=0.5, status_forcelist=[429, 500, 502, 503, 504]) adapter = HTTPAdapter(max_retries=retry) session.mount('https://', adapter) resp = session.get("https://url.com", headers={"Authorization": f"Bearer {token}"}) Does anyone see anything I am doing wrong in adding this session adapter or is there a fix that works better for this problem?


Источник: https://stackoverflow.com/questions/780 ... es-exceeed
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Python»