internet.md
1> **Источник:** https://python-all.ru/3.1/library/internet.html2>3> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.45---67# 20. Интернет-протоколы и поддержка89Модули, описанные в этой главе, реализуют интернет-протоколы и поддержку смежных технологий. Все они реализованы на Python. Большинство этих модулей требуют наличия системно-зависимого модуля [`socket`](https://python-all.ru/3.1/library/socket.html#module-socket), который в настоящее время поддерживается на большинстве популярных платформ. Здесь представлен обзор:1011- [20.1. `webbrowser` – Удобный контроллер веб-браузера](https://python-all.ru/3.1/library/webbrowser.html)1213 - [20.1.1. Объекты контроллера браузера](https://python-all.ru/3.1/library/webbrowser.html#browser-controller-objects)14- [20.2. `cgi` – Поддержка Common Gateway Interface](https://python-all.ru/3.1/library/cgi.html)1516 - [20.2.1. Введение](https://python-all.ru/3.1/library/cgi.html#introduction)17 - [20.2.2. Использование модуля cgi](https://python-all.ru/3.1/library/cgi.html#using-the-cgi-module)18 - [20.2.3. Интерфейс высокого уровня](https://python-all.ru/3.1/library/cgi.html#higher-level-interface)19 - [20.2.4. Функции](https://python-all.ru/3.1/library/cgi.html#functions)20 - [20.2.5. Вопросы безопасности](https://python-all.ru/3.1/library/cgi.html#caring-about-security)21 - [20.2.6. Установка CGI-скрипта в системе Unix](https://python-all.ru/3.1/library/cgi.html#installing-your-cgi-script-on-a-unix-system)22 - [20.2.7. Тестирование CGI-скрипта](https://python-all.ru/3.1/library/cgi.html#testing-your-cgi-script)23 - [20.2.8. Отладка CGI-скриптов](https://python-all.ru/3.1/library/cgi.html#debugging-cgi-scripts)24 - [20.2.9. Распространённые проблемы и их решения](https://python-all.ru/3.1/library/cgi.html#common-problems-and-solutions)25- [20.3. `cgitb` – Менеджер трассировки для CGI-скриптов](https://python-all.ru/3.1/library/cgitb.html)26- [20.4. `wsgiref` – Утилиты WSGI и эталонная реализация](https://python-all.ru/3.1/library/wsgiref.html)2728 - [20.4.1. `wsgiref.util` – Утилиты окружения WSGI](https://python-all.ru/3.1/library/wsgiref.html#module-wsgiref.util)29 - [20.4.2. `wsgiref.headers` – Инструменты для заголовков ответов WSGI](https://python-all.ru/3.1/library/wsgiref.html#module-wsgiref.headers)30 - [20.4.3. `wsgiref.simple_server` – Простой HTTP-сервер WSGI](https://python-all.ru/3.1/library/wsgiref.html#module-wsgiref.simple_server)31 - [20.4.4. `wsgiref.validate` – Проверка соответствия WSGI](https://python-all.ru/3.1/library/wsgiref.html#module-wsgiref.validate)32 - [20.4.5. `wsgiref.handlers` – Базовые классы сервера/шлюза](https://python-all.ru/3.1/library/wsgiref.html#module-wsgiref.handlers)33 - [20.4.6. Примеры](https://python-all.ru/3.1/library/wsgiref.html#examples)34- [20.5. `urllib.request` – Расширяемая библиотека для открытия URL](https://python-all.ru/3.1/library/urllib.request.html)3536 - [20.5.1. Объекты Request](https://python-all.ru/3.1/library/urllib.request.html#request-objects)37 - [20.5.2. Объекты OpenerDirector](https://python-all.ru/3.1/library/urllib.request.html#openerdirector-objects)38 - [20.5.3. Объекты BaseHandler](https://python-all.ru/3.1/library/urllib.request.html#basehandler-objects)39 - [20.5.4. Объекты HTTPRedirectHandler](https://python-all.ru/3.1/library/urllib.request.html#httpredirecthandler-objects)40 - [20.5.5. Объекты HTTPCookieProcessor](https://python-all.ru/3.1/library/urllib.request.html#httpcookieprocessor-objects)41 - [20.5.6. Объекты ProxyHandler](https://python-all.ru/3.1/library/urllib.request.html#proxyhandler-objects)42 - [20.5.7. Объекты HTTPPasswordMgr](https://python-all.ru/3.1/library/urllib.request.html#httppasswordmgr-objects)43 - [20.5.8. Объекты AbstractBasicAuthHandler](https://python-all.ru/3.1/library/urllib.request.html#abstractbasicauthhandler-objects)44 - [20.5.9. Объекты HTTPBasicAuthHandler](https://python-all.ru/3.1/library/urllib.request.html#httpbasicauthhandler-objects)45 - [20.5.10. Объекты ProxyBasicAuthHandler](https://python-all.ru/3.1/library/urllib.request.html#proxybasicauthhandler-objects)46 - [20.5.11. Объекты AbstractDigestAuthHandler](https://python-all.ru/3.1/library/urllib.request.html#abstractdigestauthhandler-objects)47 - [20.5.12. Объекты HTTPDigestAuthHandler](https://python-all.ru/3.1/library/urllib.request.html#httpdigestauthhandler-objects)48 - [20.5.13. Объекты ProxyDigestAuthHandler](https://python-all.ru/3.1/library/urllib.request.html#proxydigestauthhandler-objects)49 - [20.5.14. Объекты HTTPHandler](https://python-all.ru/3.1/library/urllib.request.html#httphandler-objects)50 - [20.5.15. Объекты HTTPSHandler](https://python-all.ru/3.1/library/urllib.request.html#httpshandler-objects)51 - [20.5.16. Объекты FileHandler](https://python-all.ru/3.1/library/urllib.request.html#filehandler-objects)52 - [20.5.17. Объекты FTPHandler](https://python-all.ru/3.1/library/urllib.request.html#ftphandler-objects)53 - [20.5.18. Объекты CacheFTPHandler](https://python-all.ru/3.1/library/urllib.request.html#cacheftphandler-objects)54 - [20.5.19. Объекты UnknownHandler](https://python-all.ru/3.1/library/urllib.request.html#unknownhandler-objects)55 - [20.5.20. Объекты HTTPErrorProcessor](https://python-all.ru/3.1/library/urllib.request.html#httperrorprocessor-objects)56 - [20.5.21. Примеры](https://python-all.ru/3.1/library/urllib.request.html#examples)57 - [20.5.22. `urllib.request` Ограничения](https://python-all.ru/3.1/library/urllib.request.html#urllib-request-restrictions)58- [20.6. `urllib.response` – Классы ответов, используемые urllib](https://python-all.ru/3.1/library/urllib.request.html#module-urllib.response)59- [20.7. `urllib.parse` – Разбор URL на компоненты](https://python-all.ru/3.1/library/urllib.parse.html)6061 - [20.7.1. Результаты `urlparse()` и `urlsplit()`](https://python-all.ru/3.1/library/urllib.parse.html#results-of-urlparse-and-urlsplit)62- [20.8. `urllib.error` – Классы исключений, вызываемые urllib.request](https://python-all.ru/3.1/library/urllib.error.html)63- [20.9. `urllib.robotparser` – Парсер для robots.txt](https://python-all.ru/3.1/library/urllib.robotparser.html)64- [20.10. `http.client` – Клиент протокола HTTP](https://python-all.ru/3.1/library/http.client.html)6566 - [20.10.1. Объекты HTTPConnection](https://python-all.ru/3.1/library/http.client.html#httpconnection-objects)67 - [20.10.2. Объекты HTTPResponse](https://python-all.ru/3.1/library/http.client.html#httpresponse-objects)68 - [20.10.3. Примеры](https://python-all.ru/3.1/library/http.client.html#examples)69 - [20.10.4. Объекты HTTPMessage](https://python-all.ru/3.1/library/http.client.html#httpmessage-objects)70- [20.11. `ftplib` – Клиент протокола FTP](https://python-all.ru/3.1/library/ftplib.html)7172 - [20.11.1. Объекты FTP](https://python-all.ru/3.1/library/ftplib.html#ftp-objects)73- [20.12. `poplib` – Клиент протокола POP3](https://python-all.ru/3.1/library/poplib.html)7475 - [20.12.1. Объекты POP3](https://python-all.ru/3.1/library/poplib.html#pop3-objects)76 - [20.12.2. Пример POP3](https://python-all.ru/3.1/library/poplib.html#pop3-example)77- [20.13. `imaplib` – Клиент протокола IMAP4](https://python-all.ru/3.1/library/imaplib.html)7879 - [20.13.1. Объекты IMAP4](https://python-all.ru/3.1/library/imaplib.html#imap4-objects)80 - [20.13.2. Пример IMAP4](https://python-all.ru/3.1/library/imaplib.html#imap4-example)81- [20.14. `nntplib` – Клиент протокола NNTP](https://python-all.ru/3.1/library/nntplib.html)8283 - [20.14.1. Объекты NNTP](https://python-all.ru/3.1/library/nntplib.html#nntp-objects)84- [20.15. `smtplib` – Клиент протокола SMTP](https://python-all.ru/3.1/library/smtplib.html)8586 - [20.15.1. Объекты SMTP](https://python-all.ru/3.1/library/smtplib.html#smtp-objects)87 - [20.15.2. Пример SMTP](https://python-all.ru/3.1/library/smtplib.html#smtp-example)88- [20.16. `smtpd` – SMTP-сервер](https://python-all.ru/3.1/library/smtpd.html)8990 - [20.16.1. Объекты SMTPServer](https://python-all.ru/3.1/library/smtpd.html#smtpserver-objects)91 - [20.16.2. Объекты DebuggingServer](https://python-all.ru/3.1/library/smtpd.html#debuggingserver-objects)92 - [20.16.3. Объекты PureProxy](https://python-all.ru/3.1/library/smtpd.html#pureproxy-objects)93 - [20.16.4. Объекты MailmanProxy](https://python-all.ru/3.1/library/smtpd.html#mailmanproxy-objects)94- [20.17. `telnetlib` – Telnet-клиент](https://python-all.ru/3.1/library/telnetlib.html)9596 - [20.17.1. Объекты Telnet](https://python-all.ru/3.1/library/telnetlib.html#telnet-objects)97 - [20.17.2. Пример Telnet](https://python-all.ru/3.1/library/telnetlib.html#telnet-example)98- [20.18. `uuid` – объекты UUID по RFC 4122](https://python-all.ru/3.1/library/uuid.html)99100 - [20.18.1. Пример](https://python-all.ru/3.1/library/uuid.html#example)101- [20.19. `socketserver` – каркас для сетевых серверов](https://python-all.ru/3.1/library/socketserver.html)102103 - [20.19.1. Замечания по созданию сервера](https://python-all.ru/3.1/library/socketserver.html#server-creation-notes)104 - [20.19.2. Объекты сервера](https://python-all.ru/3.1/library/socketserver.html#server-objects)105 - [20.19.3. Объекты RequestHandler](https://python-all.ru/3.1/library/socketserver.html#requesthandler-objects)106 - [20.19.4. Примеры](https://python-all.ru/3.1/library/socketserver.html#examples)107108 - [20.19.4.1. Пример `socketserver.TCPServer`](https://python-all.ru/3.1/library/socketserver.html#socketserver-tcpserver-example)109 - [20.19.4.2. Пример `socketserver.UDPServer`](https://python-all.ru/3.1/library/socketserver.html#socketserver-udpserver-example)110 - [20.19.4.3. Асинхронные миксины](https://python-all.ru/3.1/library/socketserver.html#asynchronous-mixins)111- [20.20. `http.server` – HTTP-серверы](https://python-all.ru/3.1/library/http.server.html)112- [20.21. `http.cookies` – управление состоянием HTTP](https://python-all.ru/3.1/library/http.cookies.html)113114 - [20.21.1. Объекты Cookie](https://python-all.ru/3.1/library/http.cookies.html#cookie-objects)115 - [20.21.2. Объекты Morsel](https://python-all.ru/3.1/library/http.cookies.html#morsel-objects)116 - [20.21.3. Пример](https://python-all.ru/3.1/library/http.cookies.html#example)117- [20.22. `http.cookiejar` – обработка cookie для HTTP-клиентов](https://python-all.ru/3.1/library/http.cookiejar.html)118119 - [20.22.1. Объекты CookieJar и FileCookieJar](https://python-all.ru/3.1/library/http.cookiejar.html#cookiejar-and-filecookiejar-objects)120 - [20.22.2. Подклассы FileCookieJar и взаимодействие с веб-браузерами](https://python-all.ru/3.1/library/http.cookiejar.html#filecookiejar-subclasses-and-co-operation-with-web-browsers)121 - [20.22.3. Объекты CookiePolicy](https://python-all.ru/3.1/library/http.cookiejar.html#cookiepolicy-objects)122 - [20.22.4. Объекты DefaultCookiePolicy](https://python-all.ru/3.1/library/http.cookiejar.html#defaultcookiepolicy-objects)123 - [20.22.5. Объекты Cookie](https://python-all.ru/3.1/library/http.cookiejar.html#cookie-objects)124 - [20.22.6. Примеры](https://python-all.ru/3.1/library/http.cookiejar.html#examples)125- [20.23. `xmlrpc.client` – клиентский доступ к XML-RPC](https://python-all.ru/3.1/library/xmlrpc.client.html)126127 - [20.23.1. Объекты ServerProxy](https://python-all.ru/3.1/library/xmlrpc.client.html#serverproxy-objects)128 - [20.23.2. Объекты DateTime](https://python-all.ru/3.1/library/xmlrpc.client.html#datetime-objects)129 - [20.23.3. Двоичные объекты](https://python-all.ru/3.1/library/xmlrpc.client.html#binary-objects)130 - [20.23.4. Объекты Fault](https://python-all.ru/3.1/library/xmlrpc.client.html#fault-objects)131 - [20.23.5. Объекты ProtocolError](https://python-all.ru/3.1/library/xmlrpc.client.html#protocolerror-objects)132 - [20.23.6. Объекты MultiCall](https://python-all.ru/3.1/library/xmlrpc.client.html#multicall-objects)133 - [20.23.7. Вспомогательные функции](https://python-all.ru/3.1/library/xmlrpc.client.html#convenience-functions)134 - [20.23.8. Пример использования клиента](https://python-all.ru/3.1/library/xmlrpc.client.html#example-of-client-usage)135 - [20.23.9. Пример использования клиента и сервера](https://python-all.ru/3.1/library/xmlrpc.client.html#example-of-client-and-server-usage)136- [20.24. `xmlrpc.server` – Базовые XML-RPC-серверы](https://python-all.ru/3.1/library/xmlrpc.server.html)137138 - [20.24.1. Объекты SimpleXMLRPCServer](https://python-all.ru/3.1/library/xmlrpc.server.html#simplexmlrpcserver-objects)139140 - [20.24.1.1. Пример SimpleXMLRPCServer](https://python-all.ru/3.1/library/xmlrpc.server.html#simplexmlrpcserver-example)141 - [20.24.2. CGIXMLRPCRequestHandler](https://python-all.ru/3.1/library/xmlrpc.server.html#cgixmlrpcrequesthandler)142 - [20.24.3. Документирование XMLRPC-сервера](https://python-all.ru/3.1/library/xmlrpc.server.html#documenting-xmlrpc-server)143 - [20.24.4. Объекты DocXMLRPCServer](https://python-all.ru/3.1/library/xmlrpc.server.html#docxmlrpcserver-objects)144 - [20.24.5. DocCGIXMLRPCRequestHandler](https://python-all.ru/3.1/library/xmlrpc.server.html#doccgixmlrpcrequesthandler)145