程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

All exceptions for python requests library

編輯:Python

Exception:

The following are exception errors under the request.exceptions module:

  • RequestException: Base class for all exceptions.
  • HTTPError(RequestException): HTTP error.
  • UnrewindableBodyError(RequestException): The request encountered an error while trying to rewind the body.
  • RetryError(RequestException): Custom retries logic failed.
  • ConnectionError(RequestException): A connection error occurred.
  • ProxyError(ConnectionError): A proxy error occurred.
  • SSLError(ConnectionError): An SSL error occurred.
  • ConnectTimeout(ConnectionError, Timeout): The connection timed out.
  • Timeout(RequestException): The request timed out; listening for this exception will listen for both ConnectTimeout and ReadTimeout exceptions.
  • ReadTimeout(Timeout): The response times out and the server does not send any data within the specified time.
  • URLRequired(RequestException): Invalid URL.
  • TooManyRedirects(RequestException): Too many redirects.
  • MissingSchema(RequestException, ValueError): The URL is missing a resource type (eg http, https or ftp).
  • InvalidSchema(RequestException, ValueError): The resource type specified by the URL is invalid, or the resource type is not supported (See defaults.py for valid schemas.).
  • InvalidURL(RequestException, ValueError): Invalid URL.
  • InvalidHeader(RequestException, ValueError): Invalid request header.
  • ChunkedEncodingError(RequestException): The server declared a chunked encoding but sent an invalid chunk.(The server declared chunked encoding but sent an invalid chunk.).
  • StreamConsumedError(RequestException,TypeError): The content of this response has already been consumed.
  • ContentDecodingError(RequestException, BaseHTTPError): Failed to decode response content.
  • InvalidJSONError: JSON error.
  • InvalidProxyURL(InvalidURL): The provided proxy URL is invalid.

Warning:

The following are exception warnings under the request.exceptions module:

  • RequestsWarning(Warning): Basic warnings for requests.
  • FileModeWarning(RequestsWarning, DeprecationWarning): The file is opened in text mode, but the request determines its binary length.
  • RequestsDependencyWarning(RequestsWarning): The imported dependency does not match the expected version range.

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved