internet.md
1> **Источник:** https://python-all.ru/3.2/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.2/library/socket.html#module-socket), который в настоящее время поддерживается на большинстве популярных платформ. Здесь представлен обзор:1011- [20.1. `webbrowser` – Удобный контроллер веб-браузера](https://python-all.ru/3.2/library/webbrowser.html)1213 - [20.1.1. Объекты контроллера браузера](https://python-all.ru/3.2/library/webbrowser.html#browser-controller-objects)14- [20.2. `cgi` – Поддержка Common Gateway Interface](https://python-all.ru/3.2/library/cgi.html)1516 - [20.2.1. Введение](https://python-all.ru/3.2/library/cgi.html#introduction)17 - [20.2.2. Использование модуля cgi](https://python-all.ru/3.2/library/cgi.html#using-the-cgi-module)18 - [20.2.3. Интерфейс высокого уровня](https://python-all.ru/3.2/library/cgi.html#higher-level-interface)19 - [20.2.4. Функции](https://python-all.ru/3.2/library/cgi.html#functions)20 - [20.2.5. Вопросы безопасности](https://python-all.ru/3.2/library/cgi.html#caring-about-security)21 - [20.2.6. Установка CGI-скрипта в системе Unix](https://python-all.ru/3.2/library/cgi.html#installing-your-cgi-script-on-a-unix-system)22 - [20.2.7. Тестирование CGI-скрипта](https://python-all.ru/3.2/library/cgi.html#testing-your-cgi-script)23 - [20.2.8. Отладка CGI-скриптов](https://python-all.ru/3.2/library/cgi.html#debugging-cgi-scripts)24 - [20.2.9. Распространённые проблемы и их решения](https://python-all.ru/3.2/library/cgi.html#common-problems-and-solutions)25- [20.3. `cgitb` – Менеджер трассировки для CGI-скриптов](https://python-all.ru/3.2/library/cgitb.html)26- [20.4. `wsgiref` – Утилиты WSGI и эталонная реализация](https://python-all.ru/3.2/library/wsgiref.html)2728 - [20.4.1. `wsgiref.util` – Утилиты окружения WSGI](https://python-all.ru/3.2/library/wsgiref.html#module-wsgiref.util)29 - [20.4.2. `wsgiref.headers` – Инструменты для заголовков ответов WSGI](https://python-all.ru/3.2/library/wsgiref.html#module-wsgiref.headers)30 - [20.4.3. `wsgiref.simple_server` – Простой HTTP-сервер WSGI](https://python-all.ru/3.2/library/wsgiref.html#module-wsgiref.simple_server)31 - [20.4.4. `wsgiref.validate` – Проверка соответствия WSGI](https://python-all.ru/3.2/library/wsgiref.html#module-wsgiref.validate)32 - [20.4.5. `wsgiref.handlers` – Базовые классы сервера/шлюза](https://python-all.ru/3.2/library/wsgiref.html#module-wsgiref.handlers)33 - [20.4.6. Примеры](https://python-all.ru/3.2/library/wsgiref.html#examples)34- [20.5. `urllib.request` – Расширяемая библиотека для открытия URL](https://python-all.ru/3.2/library/urllib.request.html)3536 - [20.5.1. Объекты Request](https://python-all.ru/3.2/library/urllib.request.html#request-objects)37 - [20.5.2. Объекты OpenerDirector](https://python-all.ru/3.2/library/urllib.request.html#openerdirector-objects)38 - [20.5.3. Объекты BaseHandler](https://python-all.ru/3.2/library/urllib.request.html#basehandler-objects)39 - [20.5.4. Объекты HTTPRedirectHandler](https://python-all.ru/3.2/library/urllib.request.html#httpredirecthandler-objects)40 - [20.5.5. Объекты HTTPCookieProcessor](https://python-all.ru/3.2/library/urllib.request.html#httpcookieprocessor-objects)41 - [20.5.6. Объекты ProxyHandler](https://python-all.ru/3.2/library/urllib.request.html#proxyhandler-objects)42 - [20.5.7. Объекты HTTPPasswordMgr](https://python-all.ru/3.2/library/urllib.request.html#httppasswordmgr-objects)43 - [20.5.8. Объекты AbstractBasicAuthHandler](https://python-all.ru/3.2/library/urllib.request.html#abstractbasicauthhandler-objects)44 - [20.5.9. Объекты HTTPBasicAuthHandler](https://python-all.ru/3.2/library/urllib.request.html#httpbasicauthhandler-objects)45 - [20.5.10. Объекты ProxyBasicAuthHandler](https://python-all.ru/3.2/library/urllib.request.html#proxybasicauthhandler-objects)46 - [20.5.11. Объекты AbstractDigestAuthHandler](https://python-all.ru/3.2/library/urllib.request.html#abstractdigestauthhandler-objects)47 - [20.5.12. Объекты HTTPDigestAuthHandler](https://python-all.ru/3.2/library/urllib.request.html#httpdigestauthhandler-objects)48 - [20.5.13. Объекты ProxyDigestAuthHandler](https://python-all.ru/3.2/library/urllib.request.html#proxydigestauthhandler-objects)49 - [20.5.14. Объекты HTTPHandler](https://python-all.ru/3.2/library/urllib.request.html#httphandler-objects)50 - [20.5.15. Объекты HTTPSHandler](https://python-all.ru/3.2/library/urllib.request.html#httpshandler-objects)51 - [20.5.16. Объекты FileHandler](https://python-all.ru/3.2/library/urllib.request.html#filehandler-objects)52 - [20.5.17. Объекты FTPHandler](https://python-all.ru/3.2/library/urllib.request.html#ftphandler-objects)53 - [20.5.18. Объекты CacheFTPHandler](https://python-all.ru/3.2/library/urllib.request.html#cacheftphandler-objects)54 - [20.5.19. Объекты UnknownHandler](https://python-all.ru/3.2/library/urllib.request.html#unknownhandler-objects)55 - [20.5.20. Объекты HTTPErrorProcessor](https://python-all.ru/3.2/library/urllib.request.html#httperrorprocessor-objects)56 - [20.5.21. Примеры](https://python-all.ru/3.2/library/urllib.request.html#examples)57 - [20.5.22. Устаревший интерфейс](https://python-all.ru/3.2/library/urllib.request.html#legacy-interface)58 - [20.5.23. `urllib.request` Ограничения](https://python-all.ru/3.2/library/urllib.request.html#urllib-request-restrictions)59- [20.6. `urllib.response` – Классы ответов, используемые urllib](https://python-all.ru/3.2/library/urllib.request.html#module-urllib.response)60- [20.7. `urllib.parse` – Разбор URL на компоненты](https://python-all.ru/3.2/library/urllib.parse.html)6162 - [20.7.1. Разбор URL](https://python-all.ru/3.2/library/urllib.parse.html#url-parsing)63 - [20.7.2. Разбор ASCII-кодированных байтов](https://python-all.ru/3.2/library/urllib.parse.html#parsing-ascii-encoded-bytes)64 - [20.7.3. Структурированные результаты разбора](https://python-all.ru/3.2/library/urllib.parse.html#structured-parse-results)65 - [20.7.4. Квотирование URL](https://python-all.ru/3.2/library/urllib.parse.html#url-quoting)66- [20.8. `urllib.error` – Классы исключений, вызываемые urllib.request](https://python-all.ru/3.2/library/urllib.error.html)67- [20.9. `urllib.robotparser` – Парсер для robots.txt](https://python-all.ru/3.2/library/urllib.robotparser.html)68- [20.10. `http.client` – Клиент протокола HTTP](https://python-all.ru/3.2/library/http.client.html)6970 - [20.10.1. Объекты HTTPConnection](https://python-all.ru/3.2/library/http.client.html#httpconnection-objects)71 - [20.10.2. Объекты HTTPResponse](https://python-all.ru/3.2/library/http.client.html#httpresponse-objects)72 - [20.10.3. Примеры](https://python-all.ru/3.2/library/http.client.html#examples)73 - [20.10.4. Объекты HTTPMessage](https://python-all.ru/3.2/library/http.client.html#httpmessage-objects)74- [20.11. `ftplib` – Клиент протокола FTP](https://python-all.ru/3.2/library/ftplib.html)7576 - [20.11.1. Объекты FTP](https://python-all.ru/3.2/library/ftplib.html#ftp-objects)77 - [20.11.2. Объекты FTP\_TLS](https://python-all.ru/3.2/library/ftplib.html#ftp-tls-objects)78- [20.12. `poplib` – Клиент протокола POP3](https://python-all.ru/3.2/library/poplib.html)7980 - [20.12.1. Объекты POP3](https://python-all.ru/3.2/library/poplib.html#pop3-objects)81 - [20.12.2. Пример POP3](https://python-all.ru/3.2/library/poplib.html#pop3-example)82- [20.13. `imaplib` – Клиент протокола IMAP4](https://python-all.ru/3.2/library/imaplib.html)8384 - [20.13.1. Объекты IMAP4](https://python-all.ru/3.2/library/imaplib.html#imap4-objects)85 - [20.13.2. Пример IMAP4](https://python-all.ru/3.2/library/imaplib.html#imap4-example)86- [20.14. `nntplib` – Клиент протокола NNTP](https://python-all.ru/3.2/library/nntplib.html)8788 - [20.14.1. Объекты NNTP](https://python-all.ru/3.2/library/nntplib.html#nntp-objects)8990 - [20.14.1.1. Атрибуты](https://python-all.ru/3.2/library/nntplib.html#attributes)91 - [20.14.1.2. Методы](https://python-all.ru/3.2/library/nntplib.html#methods)92 - [20.14.2. Вспомогательные функции](https://python-all.ru/3.2/library/nntplib.html#utility-functions)93- [20.15. `smtplib` – Клиент протокола SMTP](https://python-all.ru/3.2/library/smtplib.html)9495 - [20.15.1. Объекты SMTP](https://python-all.ru/3.2/library/smtplib.html#smtp-objects)96 - [20.15.2. Пример SMTP](https://python-all.ru/3.2/library/smtplib.html#smtp-example)97- [20.16. `smtpd` – SMTP-сервер](https://python-all.ru/3.2/library/smtpd.html)9899 - [20.16.1. Объекты SMTPServer](https://python-all.ru/3.2/library/smtpd.html#smtpserver-objects)100 - [20.16.2. Объекты DebuggingServer](https://python-all.ru/3.2/library/smtpd.html#debuggingserver-objects)101 - [20.16.3. Объекты PureProxy](https://python-all.ru/3.2/library/smtpd.html#pureproxy-objects)102 - [20.16.4. Объекты MailmanProxy](https://python-all.ru/3.2/library/smtpd.html#mailmanproxy-objects)103 - [20.16.5. Объекты SMTPChannel](https://python-all.ru/3.2/library/smtpd.html#smtpchannel-objects)104- [20.17. `telnetlib` – Telnet-клиент](https://python-all.ru/3.2/library/telnetlib.html)105106 - [20.17.1. Объекты Telnet](https://python-all.ru/3.2/library/telnetlib.html#telnet-objects)107 - [20.17.2. Пример Telnet](https://python-all.ru/3.2/library/telnetlib.html#telnet-example)108- [20.18. `uuid` – объекты UUID по RFC 4122](https://python-all.ru/3.2/library/uuid.html)109110 - [20.18.1. Пример](https://python-all.ru/3.2/library/uuid.html#example)111- [20.19. `socketserver` – каркас для сетевых серверов](https://python-all.ru/3.2/library/socketserver.html)112113 - [20.19.1. Замечания по созданию сервера](https://python-all.ru/3.2/library/socketserver.html#server-creation-notes)114 - [20.19.2. Объекты сервера](https://python-all.ru/3.2/library/socketserver.html#server-objects)115 - [20.19.3. Объекты RequestHandler](https://python-all.ru/3.2/library/socketserver.html#requesthandler-objects)116 - [20.19.4. Примеры](https://python-all.ru/3.2/library/socketserver.html#examples)117118 - [20.19.4.1. Пример `socketserver.TCPServer`](https://python-all.ru/3.2/library/socketserver.html#socketserver-tcpserver-example)119 - [20.19.4.2. Пример `socketserver.UDPServer`](https://python-all.ru/3.2/library/socketserver.html#socketserver-udpserver-example)120 - [20.19.4.3. Асинхронные миксины](https://python-all.ru/3.2/library/socketserver.html#asynchronous-mixins)121- [20.20. `http.server` – HTTP-серверы](https://python-all.ru/3.2/library/http.server.html)122- [20.21. `http.cookies` – управление состоянием HTTP](https://python-all.ru/3.2/library/http.cookies.html)123124 - [20.21.1. Объекты Cookie](https://python-all.ru/3.2/library/http.cookies.html#cookie-objects)125 - [20.21.2. Объекты Morsel](https://python-all.ru/3.2/library/http.cookies.html#morsel-objects)126 - [20.21.3. Пример](https://python-all.ru/3.2/library/http.cookies.html#example)127- [20.22. `http.cookiejar` – обработка cookie для HTTP-клиентов](https://python-all.ru/3.2/library/http.cookiejar.html)128129 - [20.22.1. Объекты CookieJar и FileCookieJar](https://python-all.ru/3.2/library/http.cookiejar.html#cookiejar-and-filecookiejar-objects)130 - [20.22.2. Подклассы FileCookieJar и взаимодействие с веб-браузерами](https://python-all.ru/3.2/library/http.cookiejar.html#filecookiejar-subclasses-and-co-operation-with-web-browsers)131 - [20.22.3. Объекты CookiePolicy](https://python-all.ru/3.2/library/http.cookiejar.html#cookiepolicy-objects)132 - [20.22.4. Объекты DefaultCookiePolicy](https://python-all.ru/3.2/library/http.cookiejar.html#defaultcookiepolicy-objects)133 - [20.22.5. Объекты Cookie](https://python-all.ru/3.2/library/http.cookiejar.html#cookie-objects)134 - [20.22.6. Примеры](https://python-all.ru/3.2/library/http.cookiejar.html#examples)135- [20.23. `xmlrpc.client` – клиентский доступ к XML-RPC](https://python-all.ru/3.2/library/xmlrpc.client.html)136137 - [20.23.1. Объекты ServerProxy](https://python-all.ru/3.2/library/xmlrpc.client.html#serverproxy-objects)138 - [20.23.2. Объекты DateTime](https://python-all.ru/3.2/library/xmlrpc.client.html#datetime-objects)139 - [20.23.3. Двоичные объекты](https://python-all.ru/3.2/library/xmlrpc.client.html#binary-objects)140 - [20.23.4. Объекты Fault](https://python-all.ru/3.2/library/xmlrpc.client.html#fault-objects)141 - [20.23.5. Объекты ProtocolError](https://python-all.ru/3.2/library/xmlrpc.client.html#protocolerror-objects)142 - [20.23.6. Объекты MultiCall](https://python-all.ru/3.2/library/xmlrpc.client.html#multicall-objects)143 - [20.23.7. Вспомогательные функции](https://python-all.ru/3.2/library/xmlrpc.client.html#convenience-functions)144 - [20.23.8. Пример использования клиента](https://python-all.ru/3.2/library/xmlrpc.client.html#example-of-client-usage)145 - [20.23.9. Пример использования клиента и сервера](https://python-all.ru/3.2/library/xmlrpc.client.html#example-of-client-and-server-usage)146- [20.24. `xmlrpc.server` – Базовые XML-RPC-серверы](https://python-all.ru/3.2/library/xmlrpc.server.html)147148 - [20.24.1. Объекты SimpleXMLRPCServer](https://python-all.ru/3.2/library/xmlrpc.server.html#simplexmlrpcserver-objects)149150 - [20.24.1.1. Пример SimpleXMLRPCServer](https://python-all.ru/3.2/library/xmlrpc.server.html#simplexmlrpcserver-example)151 - [20.24.2. CGIXMLRPCRequestHandler](https://python-all.ru/3.2/library/xmlrpc.server.html#cgixmlrpcrequesthandler)152 - [20.24.3. Документирование XMLRPC-сервера](https://python-all.ru/3.2/library/xmlrpc.server.html#documenting-xmlrpc-server)153 - [20.24.4. Объекты DocXMLRPCServer](https://python-all.ru/3.2/library/xmlrpc.server.html#docxmlrpcserver-objects)154 - [20.24.5. DocCGIXMLRPCRequestHandler](https://python-all.ru/3.2/library/xmlrpc.server.html#doccgixmlrpcrequesthandler)155