Requests
Backend & InfraA simple, yet elegant, HTTP library.
Release History
Common Errors
MaxRetryError4 reportsMaxRetryError in requests usually arises from SSL/TLS verification failures, often due to self-signed certificates or hostname mismatches. To fix it, either install a valid certificate, or bypass verification by setting `verify=False` in the `requests` call (though this is less secure), or specify the path to your self-signed certificate bundle using `verify='/path/to/your/cert.pem'`. Remember to handle insecure requests with caution.
FileNotFoundError2 reportsFileNotFoundError in requests often arises when the SSL certificate file (either the default or a custom one specified via the `verify` parameter) cannot be located. To fix this, ensure the certificate path is correct or explicitly set `verify=False` (though strongly discouraged for production) if certificate verification is not immediately possible; properly installing or pointing to a valid certificate bundle is the preferred solution. You might also need to reinstall the `certifi` package if it's corrupted, as it provides the default certificate bundle.
ChunkedEncodingError2 reportsChunkedEncodingError usually arises from issues with the server's response, particularly incomplete or malformed chunked data. To fix, try increasing the timeout value in your requests call to allow more time for the complete response, or verify the server is functioning correctly by testing it with a different client like `curl`. If the issue persists, examine the server-side logs to identify why the response may be truncated.
ConnectTimeoutError1 reportConnectTimeoutError in requests usually indicates the connection to the server timed out because it took too long to establish. To fix it, either increase the `timeout` value in your requests call (e.g., `requests.get(url, timeout=30)`) to allow more time or verify that the server you are trying to reach is actually available and reachable from your network since network issues or server outages can also cause this.
ContentDecodingError1 reportContentDecodingError in requests usually arises when the server sends compressed data (like gzip) without properly indicating the encoding or with a mismatch between the indicated and actual encoding. To fix this, try explicitly setting the `Accept-Encoding` header to `'identity'` to disable compression or ensure the server is correctly setting the `Content-Encoding` header to match the compression used, and that `requests` can handle it. If the server is sending corrupted compressed data, examine server-side configuration.
HostChangedError1 reportThe "HostChangedError" in requests usually arises when the TLS connection's hostname verification fails because the server certificate doesn't match the requested hostname. To resolve this, ensure the hostname you're requesting precisely matches a Subject Alternative Name (SAN) or the Common Name (CN) in the server's certificate. If you're connecting to a server via IP address, especially HTTPS, either update the server certificate to include the IP address in SAN or temporarily disable hostname verification (which severely degrades security and should only be done for testing purposes).
Related Backend & Infra Packages
Production-Grade Container Scheduling and Management
Node.js JavaScript runtime ✨🐢🚀✨
Promise based HTTP client for the browser and node.js
A modern runtime for JavaScript and TypeScript.
Deliver web apps with confidence 🚀
Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
Subscribe to Updates
Get notified when new versions are released