请求错误:是否已确定超时错误或ConnectionError之后API调用失败?

时间:2019-05-22 22:24:16

标签: python error-handling python-requests

我正在使用以下格式的python请求模块:

import requests
while True:
    try:
        data = requests.get(....)
        break
    except requests.exceptions.Timeout:
        continue
    except requests.exceptions.ConnectionError:
        continue

是否已保证没有数据与API进行任何传输,并且如果发生这两个错误中的任何一个,API将不会注册我的调用?

我不能多次允许调用在API端成功。

0 个答案:

没有答案