Документация Python неофициальный перевод

internet.md

192 строк · 17.9 КБ · обычная страница · сырой текст · скачать

1> **Источник:** https://python-all.ru/3.8/library/internet.html2>3> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.45---67# Интернет-протоколы и поддержка89Модули, описанные в этой главе, реализуют интернет-протоколы и поддержку связанных технологий. Все они реализованы на Python. Большинству из этих модулей требуется наличие системно-зависимого модуля [`socket`](https://python-all.ru/3.8/library/socket.html#module-socket), который в настоящее время поддерживается на большинстве популярных платформ. Вот обзор:1011- [`webbrowser` – Удобный контроллер веб-браузера](https://python-all.ru/3.8/library/webbrowser.html)1213  - [Объекты управления браузером](https://python-all.ru/3.8/library/webbrowser.html#browser-controller-objects)14- [`cgi` – поддержка Common Gateway Interface](https://python-all.ru/3.8/library/cgi.html)1516  - [Введение](https://python-all.ru/3.8/library/cgi.html#introduction)17  - [Использование модуля cgi](https://python-all.ru/3.8/library/cgi.html#using-the-cgi-module)18  - [Интерфейс высокого уровня](https://python-all.ru/3.8/library/cgi.html#higher-level-interface)19  - [Функции](https://python-all.ru/3.8/library/cgi.html#functions)20  - [Вопросы безопасности](https://python-all.ru/3.8/library/cgi.html#caring-about-security)21  - [Установка CGI-скрипта в системе Unix](https://python-all.ru/3.8/library/cgi.html#installing-your-cgi-script-on-a-unix-system)22  - [Тестирование CGI-скрипта](https://python-all.ru/3.8/library/cgi.html#testing-your-cgi-script)23  - [Отладка CGI-скриптов](https://python-all.ru/3.8/library/cgi.html#debugging-cgi-scripts)24  - [Типичные проблемы и решения](https://python-all.ru/3.8/library/cgi.html#common-problems-and-solutions)25- [`cgitb` – менеджер трассировки для CGI-скриптов](https://python-all.ru/3.8/library/cgitb.html)26- [`wsgiref` – Утилиты WSGI и эталонная реализация](https://python-all.ru/3.8/library/wsgiref.html)2728  - [`wsgiref.util` – Утилиты окружения WSGI](https://python-all.ru/3.8/library/wsgiref.html#module-wsgiref.util)29  - [`wsgiref.headers` – Инструменты для заголовков ответов WSGI](https://python-all.ru/3.8/library/wsgiref.html#module-wsgiref.headers)30  - [`wsgiref.simple_server` – Простой HTTP-сервер WSGI](https://python-all.ru/3.8/library/wsgiref.html#module-wsgiref.simple_server)31  - [`wsgiref.validate` – Проверка соответствия WSGI](https://python-all.ru/3.8/library/wsgiref.html#module-wsgiref.validate)32  - [`wsgiref.handlers` – Базовые классы сервера/шлюза](https://python-all.ru/3.8/library/wsgiref.html#module-wsgiref.handlers)33  - [Примеры](https://python-all.ru/3.8/library/wsgiref.html#examples)34- [`urllib` – Модули обработки URL](https://python-all.ru/3.8/library/urllib.html)35- [`urllib.request` – Расширяемая библиотека для открытия URL](https://python-all.ru/3.8/library/urllib.request.html)3637  - [Объекты Request](https://python-all.ru/3.8/library/urllib.request.html#request-objects)38  - [Объекты OpenerDirector](https://python-all.ru/3.8/library/urllib.request.html#openerdirector-objects)39  - [Объекты BaseHandler](https://python-all.ru/3.8/library/urllib.request.html#basehandler-objects)40  - [Объекты HTTPRedirectHandler](https://python-all.ru/3.8/library/urllib.request.html#httpredirecthandler-objects)41  - [Объекты HTTPCookieProcessor](https://python-all.ru/3.8/library/urllib.request.html#httpcookieprocessor-objects)42  - [Объекты ProxyHandler](https://python-all.ru/3.8/library/urllib.request.html#proxyhandler-objects)43  - [Объекты HTTPPasswordMgr](https://python-all.ru/3.8/library/urllib.request.html#httppasswordmgr-objects)44  - [Объекты HTTPPasswordMgrWithPriorAuth](https://python-all.ru/3.8/library/urllib.request.html#httppasswordmgrwithpriorauth-objects)45  - [Объекты AbstractBasicAuthHandler](https://python-all.ru/3.8/library/urllib.request.html#abstractbasicauthhandler-objects)46  - [Объекты HTTPBasicAuthHandler](https://python-all.ru/3.8/library/urllib.request.html#httpbasicauthhandler-objects)47  - [Объекты ProxyBasicAuthHandler](https://python-all.ru/3.8/library/urllib.request.html#proxybasicauthhandler-objects)48  - [Объекты AbstractDigestAuthHandler](https://python-all.ru/3.8/library/urllib.request.html#abstractdigestauthhandler-objects)49  - [Объекты HTTPDigestAuthHandler](https://python-all.ru/3.8/library/urllib.request.html#httpdigestauthhandler-objects)50  - [Объекты ProxyDigestAuthHandler](https://python-all.ru/3.8/library/urllib.request.html#proxydigestauthhandler-objects)51  - [Объекты HTTPHandler](https://python-all.ru/3.8/library/urllib.request.html#httphandler-objects)52  - [Объекты HTTPSHandler](https://python-all.ru/3.8/library/urllib.request.html#httpshandler-objects)53  - [Объекты FileHandler](https://python-all.ru/3.8/library/urllib.request.html#filehandler-objects)54  - [Объекты DataHandler](https://python-all.ru/3.8/library/urllib.request.html#datahandler-objects)55  - [Объекты FTPHandler](https://python-all.ru/3.8/library/urllib.request.html#ftphandler-objects)56  - [Объекты CacheFTPHandler](https://python-all.ru/3.8/library/urllib.request.html#cacheftphandler-objects)57  - [Объекты UnknownHandler](https://python-all.ru/3.8/library/urllib.request.html#unknownhandler-objects)58  - [Объекты HTTPErrorProcessor](https://python-all.ru/3.8/library/urllib.request.html#httperrorprocessor-objects)59  - [Примеры](https://python-all.ru/3.8/library/urllib.request.html#examples)60  - [Устаревший интерфейс](https://python-all.ru/3.8/library/urllib.request.html#legacy-interface)61  - [`urllib.request` Ограничения](https://python-all.ru/3.8/library/urllib.request.html#urllib-request-restrictions)62- [`urllib.response` – Классы ответов, используемые urllib](https://python-all.ru/3.8/library/urllib.request.html#module-urllib.response)63- [`urllib.parse` – Разбор URL на компоненты](https://python-all.ru/3.8/library/urllib.parse.html)6465  - [Разбор URL](https://python-all.ru/3.8/library/urllib.parse.html#url-parsing)66  - [Безопасность разбора URL](https://python-all.ru/3.8/library/urllib.parse.html#url-parsing-security)67  - [Разбор ASCII-закодированных байтов](https://python-all.ru/3.8/library/urllib.parse.html#parsing-ascii-encoded-bytes)68  - [Структурированные результаты разбора](https://python-all.ru/3.8/library/urllib.parse.html#structured-parse-results)69  - [Экранирование URL](https://python-all.ru/3.8/library/urllib.parse.html#url-quoting)70- [`urllib.error` – Классы исключений, вызываемые urllib.request](https://python-all.ru/3.8/library/urllib.error.html)71- [`urllib.robotparser` – Парсер для robots.txt](https://python-all.ru/3.8/library/urllib.robotparser.html)72- [`http` – Модули HTTP](https://python-all.ru/3.8/library/http.html)7374  - [Коды состояния HTTP](https://python-all.ru/3.8/library/http.html#http-status-codes)75- [`http.client` – Клиент протокола HTTP](https://python-all.ru/3.8/library/http.client.html)7677  - [Объекты HTTPConnection](https://python-all.ru/3.8/library/http.client.html#httpconnection-objects)78  - [Объекты HTTPResponse](https://python-all.ru/3.8/library/http.client.html#httpresponse-objects)79  - [Примеры](https://python-all.ru/3.8/library/http.client.html#examples)80  - [Объекты HTTPMessage](https://python-all.ru/3.8/library/http.client.html#httpmessage-objects)81- [`ftplib` – клиент протокола FTP](https://python-all.ru/3.8/library/ftplib.html)8283  - [Объекты FTP](https://python-all.ru/3.8/library/ftplib.html#ftp-objects)84  - [Объекты FTP\_TLS](https://python-all.ru/3.8/library/ftplib.html#ftp-tls-objects)85- [`poplib` – клиент протокола POP3](https://python-all.ru/3.8/library/poplib.html)8687  - [Объекты POP3](https://python-all.ru/3.8/library/poplib.html#pop3-objects)88  - [Пример POP3](https://python-all.ru/3.8/library/poplib.html#pop3-example)89- [`imaplib` – клиент протокола IMAP4](https://python-all.ru/3.8/library/imaplib.html)9091  - [Объекты IMAP4](https://python-all.ru/3.8/library/imaplib.html#imap4-objects)92  - [Пример IMAP4](https://python-all.ru/3.8/library/imaplib.html#imap4-example)93- [`nntplib` – клиент протокола NNTP](https://python-all.ru/3.8/library/nntplib.html)9495  - [Объекты NNTP](https://python-all.ru/3.8/library/nntplib.html#nntp-objects)9697    - [Атрибуты](https://python-all.ru/3.8/library/nntplib.html#attributes)98    - [Методы](https://python-all.ru/3.8/library/nntplib.html#methods)99  - [Вспомогательные функции](https://python-all.ru/3.8/library/nntplib.html#utility-functions)100- [`smtplib` – клиент протокола SMTP](https://python-all.ru/3.8/library/smtplib.html)101102  - [Объекты SMTP](https://python-all.ru/3.8/library/smtplib.html#smtp-objects)103  - [Пример SMTP](https://python-all.ru/3.8/library/smtplib.html#smtp-example)104- [`smtpd` – SMTP-сервер](https://python-all.ru/3.8/library/smtpd.html)105106  - [Объекты SMTPServer](https://python-all.ru/3.8/library/smtpd.html#smtpserver-objects)107  - [Объекты DebuggingServer](https://python-all.ru/3.8/library/smtpd.html#debuggingserver-objects)108  - [Объекты PureProxy](https://python-all.ru/3.8/library/smtpd.html#pureproxy-objects)109  - [Объекты MailmanProxy](https://python-all.ru/3.8/library/smtpd.html#mailmanproxy-objects)110  - [Объекты SMTPChannel](https://python-all.ru/3.8/library/smtpd.html#smtpchannel-objects)111- [`telnetlib` – Telnet-клиент](https://python-all.ru/3.8/library/telnetlib.html)112113  - [Объекты Telnet](https://python-all.ru/3.8/library/telnetlib.html#telnet-objects)114  - [Пример Telnet](https://python-all.ru/3.8/library/telnetlib.html#telnet-example)115- [`uuid` – объекты UUID в соответствии с **RFC 4122**](https://python-all.ru/3.8/library/uuid.html)116117  - [Пример](https://python-all.ru/3.8/library/uuid.html#example)118- [`socketserver` – фреймворк для сетевых серверов](https://python-all.ru/3.8/library/socketserver.html)119120  - [Замечания по созданию сервера](https://python-all.ru/3.8/library/socketserver.html#server-creation-notes)121  - [Объекты сервера](https://python-all.ru/3.8/library/socketserver.html#server-objects)122  - [Объекты обработчиков запросов](https://python-all.ru/3.8/library/socketserver.html#request-handler-objects)123  - [Примеры](https://python-all.ru/3.8/library/socketserver.html#examples)124125    - [`socketserver.TCPServer` Пример](https://python-all.ru/3.8/library/socketserver.html#socketserver-tcpserver-example)126    - [`socketserver.UDPServer` Пример](https://python-all.ru/3.8/library/socketserver.html#socketserver-udpserver-example)127    - [Асинхронные примеси](https://python-all.ru/3.8/library/socketserver.html#asynchronous-mixins)128- [`http.server` – HTTP-серверы](https://python-all.ru/3.8/library/http.server.html)129130  - [Вопросы безопасности](https://python-all.ru/3.8/library/http.server.html#security-considerations)131- [`http.cookies` – управление состоянием HTTP](https://python-all.ru/3.8/library/http.cookies.html)132133  - [Объекты Cookie](https://python-all.ru/3.8/library/http.cookies.html#cookie-objects)134  - [Объекты Morsel](https://python-all.ru/3.8/library/http.cookies.html#morsel-objects)135  - [Пример](https://python-all.ru/3.8/library/http.cookies.html#example)136- [`http.cookiejar` – Обработка cookie для HTTP-клиентов](https://python-all.ru/3.8/library/http.cookiejar.html)137138  - [Объекты CookieJar и FileCookieJar](https://python-all.ru/3.8/library/http.cookiejar.html#cookiejar-and-filecookiejar-objects)139  - [Подклассы FileCookieJar и взаимодействие с веб-браузерами](https://python-all.ru/3.8/library/http.cookiejar.html#filecookiejar-subclasses-and-co-operation-with-web-browsers)140  - [Объекты CookiePolicy](https://python-all.ru/3.8/library/http.cookiejar.html#cookiepolicy-objects)141  - [Объекты DefaultCookiePolicy](https://python-all.ru/3.8/library/http.cookiejar.html#defaultcookiepolicy-objects)142  - [Объекты Cookie](https://python-all.ru/3.8/library/http.cookiejar.html#cookie-objects)143  - [Примеры](https://python-all.ru/3.8/library/http.cookiejar.html#examples)144- [`xmlrpc` – Модули сервера и клиента XML-RPC](https://python-all.ru/3.8/library/xmlrpc.html)145- [`xmlrpc.client` – Доступ клиента XML-RPC](https://python-all.ru/3.8/library/xmlrpc.client.html)146147  - [Объекты ServerProxy](https://python-all.ru/3.8/library/xmlrpc.client.html#serverproxy-objects)148  - [Объекты datetime](https://python-all.ru/3.8/library/xmlrpc.client.html#datetime-objects)149  - [Объекты Binary](https://python-all.ru/3.8/library/xmlrpc.client.html#binary-objects)150  - [Объекты Fault](https://python-all.ru/3.8/library/xmlrpc.client.html#fault-objects)151  - [Объекты ProtocolError](https://python-all.ru/3.8/library/xmlrpc.client.html#protocolerror-objects)152  - [Объекты MultiCall](https://python-all.ru/3.8/library/xmlrpc.client.html#multicall-objects)153  - [Удобные функции](https://python-all.ru/3.8/library/xmlrpc.client.html#convenience-functions)154  - [Пример использования клиента](https://python-all.ru/3.8/library/xmlrpc.client.html#example-of-client-usage)155  - [Пример использования клиента и сервера](https://python-all.ru/3.8/library/xmlrpc.client.html#example-of-client-and-server-usage)156- [`xmlrpc.server` – Базовые серверы XML-RPC](https://python-all.ru/3.8/library/xmlrpc.server.html)157158  - [Объекты SimpleXMLRPCServer](https://python-all.ru/3.8/library/xmlrpc.server.html#simplexmlrpcserver-objects)159160    - [Пример SimpleXMLRPCServer](https://python-all.ru/3.8/library/xmlrpc.server.html#simplexmlrpcserver-example)161  - [CGIXMLRPCRequestHandler](https://python-all.ru/3.8/library/xmlrpc.server.html#cgixmlrpcrequesthandler)162  - [Документирование сервера XML-RPC](https://python-all.ru/3.8/library/xmlrpc.server.html#documenting-xmlrpc-server)163  - [Объекты DocXMLRPCServer](https://python-all.ru/3.8/library/xmlrpc.server.html#docxmlrpcserver-objects)164  - [DocCGIXMLRPCRequestHandler](https://python-all.ru/3.8/library/xmlrpc.server.html#doccgixmlrpcrequesthandler)165- [`ipaddress` – Библиотека для работы с IPv4/IPv6](https://python-all.ru/3.8/library/ipaddress.html)166167  - [Удобные фабричные функции](https://python-all.ru/3.8/library/ipaddress.html#convenience-factory-functions)168  - [IP-адреса](https://python-all.ru/3.8/library/ipaddress.html#ip-addresses)169170    - [Объекты адресов](https://python-all.ru/3.8/library/ipaddress.html#address-objects)171    - [Преобразование в строки и целые числа](https://python-all.ru/3.8/library/ipaddress.html#conversion-to-strings-and-integers)172    - [Операторы](https://python-all.ru/3.8/library/ipaddress.html#operators)173174      - [Операторы сравнения](https://python-all.ru/3.8/library/ipaddress.html#comparison-operators)175      - [Арифметические операторы](https://python-all.ru/3.8/library/ipaddress.html#arithmetic-operators)176  - [Определения IP-сетей](https://python-all.ru/3.8/library/ipaddress.html#ip-network-definitions)177178    - [Префикс, маска сети и маска узла](https://python-all.ru/3.8/library/ipaddress.html#prefix-net-mask-and-host-mask)179    - [Объекты сетей](https://python-all.ru/3.8/library/ipaddress.html#network-objects)180    - [Операторы](https://python-all.ru/3.8/library/ipaddress.html#id1)181182      - [Логические операторы](https://python-all.ru/3.8/library/ipaddress.html#logical-operators)183      - [Итерация](https://python-all.ru/3.8/library/ipaddress.html#iteration)184      - [Сети как контейнеры адресов](https://python-all.ru/3.8/library/ipaddress.html#networks-as-containers-of-addresses)185  - [Объекты интерфейсов](https://python-all.ru/3.8/library/ipaddress.html#interface-objects)186187    - [Операторы](https://python-all.ru/3.8/library/ipaddress.html#id2)188189      - [Логические операторы](https://python-all.ru/3.8/library/ipaddress.html#id3)190  - [Прочие функции уровня модуля](https://python-all.ru/3.8/library/ipaddress.html#other-module-level-functions)191  - [Пользовательские исключения](https://python-all.ru/3.8/library/ipaddress.html#custom-exceptions)192