{"id":446087,"date":"2025-01-24T21:05:01","date_gmt":"2025-01-24T21:05:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=446087"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=446087","title":{"rendered":"<span>\u041e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u043f\u0443\u0442\u044f\u043c\u0438 \u0432 FastAPI<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Python, \u0432\u044b\u0441\u043e\u043a\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 FastAPI. \u0412 FastAPI \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441 \u043d\u0438\u043c \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443. \u041d\u043e \u0432 FastAPI \u0435\u0441\u0442\u044c \u0438 \u043d\u0435\u043c\u0430\u043b\u043e \u043d\u044e\u0430\u043d\u0441\u043e\u0432, \u043d\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f. \u041c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043f\u043e\u0442\u0435\u0442\u044c \u0441 \u043e\u0434\u043d\u0438\u043c \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u043c, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2014 \u043a\u0430\u043a FastAPI \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438 \u043a \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u043c API <a href=\"https:\/\/fastapi.tiangolo.com\/tutorial\/path-params\/\">\u0447\u0435\u0440\u0435\u0437 \u0434\u0435\u043a\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0443\u0442\u0438<\/a>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c.<\/p>\n<h3>\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/h3>\n<p> \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0432\u0430\u0436\u043d\u0435\u0439\u0448\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043b\u044e\u0431\u043e\u0433\u043e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/newsletter.vickiboykis.com\/archive\/when-you-write-a-web-server-but-you-get-served\/\">\u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440<\/a>, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0441\u043b\u0443\u0448\u0430\u044e\u0449\u0430\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0435 \u0438\u0437 \u0441\u0435\u0442\u0438. \u0417\u0430\u0442\u0435\u043c \u043e\u043d\u0430 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u0435.<\/p>\n<p> \u0427\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c <code>http.server<\/code>, <a href=\"https:\/\/github.com\/python\/cpython\/blob\/main\/Lib\/http\/server.py\">\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 Python<\/a>.<\/p>\n<p> \u041d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043b\u0443\u0448\u0430\u0435\u0442 \u043f\u043e\u0440\u0442 \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e: \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u0443\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0451\u043d\u043d\u044b\u0435 \u043a HTTP-\u0432\u044b\u0437\u043e\u0432\u0443. \u0421\u043c. \u0442\u0430\u043a\u0436\u0435 \u201c<a href=\"https:\/\/crawshaw.io\/blog\/programming-with-llms\">All I want is to cURL and parse a JSON object<\/a>\u201d. <a name=\"habracut\"><\/a><\/p>\n<pre><code class=\"python\">import json from http.server import BaseHTTPRequestHandler, HTTPServer from urllib.parse import urlparse, parse_qs  class RequestHandler(BaseHTTPRequestHandler):      def parse_path(self, request_path: str)-&gt; dict:         \"\"\"         Parse request path         \"\"\"         parsed = urlparse(request_path)         print(parsed)         params_dict = parse_qs(parsed.query)         return params_dict      def store_urls(self, request_path: str)-&gt; None:         \"\"\"         Parse URLs and store them         \"\"\"         params = self.parse_path(request_path)         print(params)         for key, val in params.items():             self.data_store.put_data(val[0])       def return_k_json(self, k:dict)-&gt; BinaryIO:         \"\"\"         Return json response         \"\"\"         self.send_response(200)         self.send_header(\"Content-type\", \"application\/json\")         self.end_headers()         # \u0421\u043e\u0434\u043d\u043e\u0436\u0438\u0442 \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u0432\u043e\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u043e\u0442\u043a\u043b\u0438\u043a\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442.          # BufferedIOBase \u043f\u0438\u0448\u0435\u0442 \u0432 \u043f\u043e\u0442\u043e\u043a         # \u0421\u043c. https:\/\/docs.python.org\/3\/library\/io.html#io.BufferedIOBase.write         self.wfile.write(json.dumps(k).encode('utf-8'))       def bad_request(self):         \"\"\"         Handle bad request         \"\"\"         self.send_response(400)         self.send_header(\"Content-type\", \"application\/json\")         self.end_headers()      def do_GET(self):                   request_path = self.path          if self.path == \"\/\":             self.return_k_json({\"ciao\": \"mondo\"})         if request_path.startswith(\"\/get\"):             key = self.parse_path(request_path)             self.return_k_json({\"jars\": key[\"key\"]})             self.send_response(200)         else:             self.bad_request()             self.end_headers()      def do_POST(self):         request_path = self.path          if request_path.startswith(\"\/set\"):             self.store_urls(request_path)             self.send_response(200)         else:             self.bad_request()   if __name__ == \"__main__\":     host = \"localhost\"     port = 8000      server = HTTPServer((host, port), RequestHandler)     print(\"Server started http:\/\/%s:%s\" % (host, port))     server.serve_forever()<\/code><\/pre>\n<p> \u0427\u0442\u043e \u0442\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442?<\/p>\n<p> \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c Nulltella, \u043a\u0440\u0430\u0444\u0442\u043e\u0432\u0443\u044e \u0448\u043e\u043a\u043e\u043b\u0430\u0434\u043d\u043e-\u043e\u0440\u0435\u0445\u043e\u0432\u0443\u044e \u043f\u0430\u0441\u0442\u0443 \u0434\u043b\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043f\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u0431\u0430\u043d\u043e\u0447\u043a\u0438 Nulltella, \u0447\u0442\u043e\u0431\u044b \u0432\u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u043d\u043e\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<p> \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 API. \u0412\u043e\u0442 \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0430\u043a \u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438:<\/p>\n<ul>\n<li>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043e\u0442\u043a\u043b\u0438\u043a <\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0431\u0430\u043d\u043e\u0447\u043a\u0438 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f <\/li>\n<li>\u041f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u043c\u0438 \u0431\u0430\u043d\u043e\u0447\u043a\u0438<\/li>\n<\/ul>\n<p> \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u044d\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u044b GET \u0438 PUT, \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0434\u043b\u044f \u043d\u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c HTTP-\u0432\u044b\u0437\u043e\u0432\u044b. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u0434\u0430\u0436\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0445 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0430 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0438\u0445. \u0422\u0430\u043a \u043c\u044b \u0431\u0435\u0437 \u0442\u0440\u0443\u0434\u0430 \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p> \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440:<\/p>\n<pre><code class=\"python\">&gt; python serve.py &gt; curl -X POST http:\/\/localhost:8000\/ &gt; {\"ciao\": \"mondo\"}<\/code><\/pre>\n<p> \u041c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b:<\/p>\n<pre><code class=\"python\">&gt; curl -X POST http:\/\/localhost:8000\/set\\?key\\=8 200 OK<\/code><\/pre>\n<p> \u0418 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043e\u0431\u0440\u0430\u0442\u043d\u043e:<\/p>\n<pre><code class=\"python\">&gt; curl -X GET http:\/\/localhost:8000\/get\\?key\\=8  &gt; {\"jars\": [\"8\"]}<\/code><\/pre>\n<p> \u041d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u043b \u0431\u044b \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<ol>\n<li>\u0422\u0438\u043f \u0437\u0430\u043f\u0440\u043e\u0441\u0430. <a href=\"https:\/\/docs.python.org\/3\/library\/http.server.html#http.server.SimpleHTTPRequestHandler.do_GET\">\u0412 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 HTTP<\/a> <code>do_GET<\/code> \u0438 <code>do_POST<\/code> <a href=\"https:\/\/stackoverflow.com\/a\/50944691\">\u043d\u0435\u044f\u0432\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442 \u044d\u0442\u043e<\/a>.<\/li>\n<li>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u043d\u0430\u043c\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0443\u0442\u0438, \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0441 \u043d\u0438\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c <\/li>\n<li>\u041c\u0430\u0440\u0448\u0440\u0443\u0442 \u043a \u0442\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 <\/li>\n<\/ol>\n<p> \u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0432\u0441\u044f \u0441\u0443\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0415\u0441\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043f\u0443\u0442\u044c, \u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u0435\u0440\u043d\u0451\u0442 {\u00abciao\u00bb: \u00abmondo\u00bb}. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u043e\u043c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u043d\u043e\u0447\u0435\u043a \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043f\u0443\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0443\u0442\u0438).<\/p>\n<pre><code class=\"python\">def do_GET(self) -&gt; None:     request_path = self.path      if self.path == \"\/\":         self.return_k_json({\"ciao\": \"mondo\"})     if request_path.startswith(\"\/get\"):         key = self.parse_path(request_path)         # \u0417\u0434\u0435\u0441\u044c \u0438\u0434\u0451\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f          self.return_k_json({\"jars\": key[\"key\"]})         self.send_response(200)     else:         self.bad_request()         self.end_headers()<\/code><\/pre>\n<p> \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0431\u044b\u0441\u0442\u0440\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442\u0441\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u0442\u0430\u043d\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 GET. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0441\u0442\u0430\u043d\u0435\u043c \u0432\u044b\u0442\u044f\u0433\u0438\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0438\u043b\u0438 \u0438\u0437 \u043a\u044d\u0448\u0430, \u0438\u043b\u0438 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b? \u0423 \u043d\u0430\u0441 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0441\u0442\u0430\u043d\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043f\u043e \u043a\u0430\u043a\u043e\u043c\u0443 \u043f\u0443\u0442\u0438 \u043f\u043e\u0448\u0451\u043b \u0440\u0430\u0437\u0431\u043e\u0440. \u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b PUT\/DELETE? \u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f? \u0417\u0430\u043f\u0438\u0441\u044c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445? \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b? \u041a\u043e\u0434 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u0438 \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043d\u0430\u043c \u0443\u0436\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a.<\/p>\n<h3>Starlette<\/h3>\n<p> \u0421\u0440\u0435\u0434\u0438 \u043f\u0435\u0440\u0432\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 Python \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u044b\u043b\u0438 \u043c\u043e\u0433\u0443\u0447\u0438\u0435 Django \u0438 Flask. \u0412 \u043d\u043e\u0432\u0435\u0439\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432 Python \u0441\u0442\u0430\u043b\u0438 \u0443\u0441\u0438\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043d\u0430 \u0441\u0446\u0435\u043d\u0443 \u0432\u044b\u0448\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438 \u043a\u0430\u043a <a href=\"https:\/\/www.starlette.io\/\">Starlette<\/a>, \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<p> \u0410\u0432\u0442\u043e\u0440 Starlette \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043b Django Rest Framework. \u0412 Starlette \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b HTTP-\u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u0430 \u043d\u0430\u0440\u044f\u0434\u0443 \u0441 \u043d\u0438\u043c \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0432\u0435\u0431-\u0441\u043e\u043a\u0435\u0442\u0430\u043c\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u043e\u043d\u0443\u0441\u0430 \u0432\u0441\u0435 \u044d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e.<\/p>\n<p> \u0427\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c HTTP-\u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438 \u043f\u043e \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443, \u043a\u0430\u043a \u0438 \u0441 \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c, \u0432 Starlette \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"python\">from starlette.applications import Starlette from starlette.responses import JSONResponse from starlette.routing import Route   async def homepage(request):     return JSONResponse({'ciao': 'mondo'})   app = Starlette(debug=True, routes=[Route('\/', homepage),])<\/code><\/pre>\n<p> \u041c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Starlette, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u0442\u044c <a href=\"https:\/\/github.com\/encode\/starlette\/blob\/7c0d1e6d1a499e6eeb68d447321838be3927e83b\/starlette\/routing.py#L208\">\u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432<\/a>. \u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0443\u0442\u0438 <a href=\"https:\/\/www.starlette.io\/routing\/\">\u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0441\u0432\u044f\u0437\u0430\u043d<\/a> \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u0442\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442. \u0415\u0441\u043b\u0438 Starlette \u0432\u0438\u0434\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442, \u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u043b\u043e\u0433\u0438\u043a\u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 \u0438 \u0442\u0435\u043b HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p> \u0410 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0443\u0436\u0435 \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0443 \u0438 \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u043d\u0430\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u043d\u043e\u0447\u0435\u043a?<\/p>\n<pre><code class=\"python\">from starlette.applications import Starlette from starlette.responses import JSONResponse from starlette.routing import Route  async def homepage(request):     return JSONResponse({'ciao': 'mondo'})  async def get_jars(request):     return JSONResponse({'jars': ['8']})  app = Starlette(debug=True, routes=[     Route('\/', homepage),     Route('\/get_jars', get_jars) ])<\/code><\/pre>\n<p> \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0437\u0434\u0435\u0441\u044c \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0438 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 <a href=\"https:\/\/github.com\/encode\/starlette\/blob\/7c0d1e6d1a499e6eeb68d447321838be3927e83b\/starlette\/_utils.py#L85\">\u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0443\u0442\u0438<\/a>, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u0435, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u043c \u0438\u0445 <a href=\"https:\/\/github.com\/encode\/starlette\/blob\/7c0d1e6d1a499e6eeb68d447321838be3927e83b\/docs\/requests.md?plain=1#L5\">\u043f\u043e \u043c\u0435\u0440\u0435 \u043f\u043e\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/a>.<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f FastAPI<\/h3>\n<p> FastAPI \u043e\u0431\u0451\u0440\u0442\u044b\u0432\u0430\u0435\u0442 Starlette \u2013 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443, \u043a\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u00ab\u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 Starlette \u043d\u0430 \u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430\u0445\u00bb \u2014 \u0438 <a href=\"https:\/\/fastapi.tiangolo.com\/alternatives\/#intro\">\u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0442\u0438\u043f\u043e\u0432 \u043f\u043e \u043c\u043e\u0434\u0435\u043b\u0438 Pydantic<\/a> \u043d\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p> \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f FastAPI, \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u043e\u043d \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u00ab\u043f\u0440\u043e\u0441\u0442\u043e\u00bb \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Starlette, \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"python\">from fastapi import FastAPI  app = FastAPI()   @app.get(\"\/\") async def root():     return {\"ciao\": \"mondo\"}  @app.get(\"\/jars\/{id}\") async def get_jars(id):     return {\"message\": f\"jars: {id}\"}<\/code><\/pre>\n<p> \u041f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 FastAPI \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <a href=\"https:\/\/www.uvicorn.org\/\">uvicorn<\/a>. \u042d\u0442\u043e <a href=\"https:\/\/asgi.readthedocs.io\/en\/latest\/\">ASGI-\u0441\u0435\u0440\u0432\u0435\u0440<\/a>, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043d \u0441\u043b\u0443\u0448\u0430\u0435\u0442 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0438\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u043c\u0438, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c\u0438 \u0443 \u0432\u0430\u0441 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<p> Uvicorn \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 ASGI-\u0441\u0435\u0440\u0432\u0435\u0440, \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u0441 <a href=\"https:\/\/github.com\/encode\/uvicorn\/blob\/ae8253f10b9f73f10e92be52a0d9f70696b77c62\/uvicorn\/server.py#L115\">\u0441\u043e\u043a\u0435\u0442\u043d\u044b\u043c\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u043c\u0438<\/a> \u043d\u0430 \u043f\u043e\u0440\u0442\u0435 8000 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 GET \u043f\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u043c\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 <a href=\"https:\/\/github.com\/encode\/uvicorn\/blob\/ae8253f10b9f73f10e92be52a0d9f70696b77c62\/uvicorn\/main.py#L73\">\u043f\u043e\u0440\u0442\u0435 8000<\/a>, \u043c\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442 ciao mondo.<\/p>\n<p> FastAPI, \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u0443\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043f\u0443\u0442\u044f\u043c\u0438 \u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0443, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u043c\u0443 \u0438\u0445 \u0438 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044e\u0449\u0435\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043d\u043e \u043e\u0431\u0451\u0440\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0451 \u044d\u0442\u043e \u0432 <a href=\"https:\/\/nedbatchelder.com\/blog\/202210\/decorator_shortcuts.html\">\u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 Python<\/a>. \u0422\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0449\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0432 \u0442\u043e\u043c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0443\u0442\u0438. <\/p>\n<p> \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432 FastAPI \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0443\u0442\u0438, \u044d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u0430 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0432\u0448\u0435\u0439\u0441\u044f \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435. \u041d\u043e \u043e\u043d\u0430 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0441\u0442\u0440\u043e\u0436\u0435 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p> \u0411\u0435\u0437 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043c\u044b: <\/p>\n<ol>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440<\/li>\n<li>\u0421\u043b\u0443\u0448\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u043f\u043e\u0440\u0442\u0435 8000 <\/li>\n<li>\u041f\u043e\u043b\u0443\u0447\u0438\u0432 \u0437\u0430\u043f\u0440\u043e\u0441, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0443 do_GET <\/li>\n<li>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0443\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u0432 &#171;\/&#187;<\/li>\n<li>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0441 \u043a\u043e\u0434\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f 200 <\/li>\n<\/ol>\n<p> \u0412 FastAPI \u043c\u044b: <\/p>\n<ol>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 uvicorn (\u0435\u0441\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u0436\u0435 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0432\u044b\u0431\u0440\u0430\u0442\u044c <a href=\"https:\/\/stackoverflow.com\/a\/71546833\">\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043a\u043b\u0430\u0441\u0441<\/a>)<\/li>\n<li>\u0421\u043b\u0443\u0448\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0430 \u043f\u043e\u0440\u0442\u0435 8000 <\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f FastAPI <\/li>\n<li>\u041e\u043d, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 Starlette<\/li>\n<li>\u041f\u043e\u043b\u0443\u0447\u0438\u0432 \u0437\u0430\u043f\u0440\u043e\u0441 GET, \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u0432 \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/github.com\/fastapi\/fastapi\/blob\/144f09ea146b2cc026bf317f730aa0e0dbc3de24\/fastapi\/applications.py#L1460\">self.get<\/a> \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/li>\n<li>\u041e\u043d, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>self.router.get<\/code> \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c <a href=\"https:\/\/github.com\/fastapi\/fastapi\/blob\/144f09ea146b2cc026bf317f730aa0e0dbc3de24\/fastapi\/applications.py#L1807\">\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0443\u0442\u0438<\/a><\/li>\n<li>\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440 \u2014 \u044d\u0442\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 <a href=\"https:\/\/github.com\/fastapi\/fastapi\/blob\/144f09ea146b2cc026bf317f730aa0e0dbc3de24\/fastapi\/applications.py#L932\">routing.APIRouter<\/a><\/li>\n<li>\u041c\u0435\u0442\u043e\u0434 <code>.get<\/code> \u0432 <a href=\"https:\/\/github.com\/fastapi\/fastapi\/blob\/144f09ea146b2cc026bf317f730aa0e0dbc3de24\/fastapi\/routing.py#L1366\">APIRouter<\/a> <a href=\"https:\/\/github.com\/fastapi\/fastapi\/blob\/144f09ea146b2cc026bf317f730aa0e0dbc3de24\/fastapi\/routing.py#L1366\">\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0443\u0442\u044c<\/a> \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>return<\/code> <code>self.api_route<\/code>. \u0418\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 \u2013 <a href=\"https:\/\/github.com\/fastapi\/fastapi\/blob\/144f09ea146b2cc026bf317f730aa0e0dbc3de24\/fastapi\/routing.py#L963\">\u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043a\u0430\u043a \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435<\/a> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0432\u043e\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>DecoratedCallable<\/code> \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u0435\u043a\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 <code>add_api_route<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438 <a href=\"https:\/\/github.com\/fastapi\/fastapi\/blob\/144f09ea146b2cc026bf317f730aa0e0dbc3de24\/fastapi\/routing.py#L961\">\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u043e\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043c\u0435\u044e\u0449\u0438\u0445\u0441\u044f<\/a>.<\/li>\n<\/ol>\n<p> \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0430\u0431\u043e\u0440 \u0442\u0435\u0445 \u0448\u0430\u0433\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u043f\u0440\u0438 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u043a\u0430 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u043d\u0430 \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u043f\u0443\u0442\u0438.<\/p>\n<h3>\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0443\u0442\u0438<\/h3>\n<p> \u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0443\u0442\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 Starlette, \u0433\u0434\u0435 <a href=\"https:\/\/github.com\/encode\/starlette\/blob\/0109dce29b76c64e93c56c01fa5020860f935ed3\/starlette\/requests.py#L182\">\u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0443\u0442\u0438<\/a>, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0445\u0441\u044f \u043a <a href=\"https:\/\/github.com\/encode\/starlette\/blob\/0109dce29b76c64e93c56c01fa5020860f935ed3\/starlette\/requests.py#L76\">\u0437\u0430\u043f\u0440\u043e\u0441\u0443<\/a>, \u0438 \u043e\u043d\u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c (\u0442\u043e\u0447\u043d\u043e \u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c). \u042d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/github.com\/encode\/starlette\/blob\/0109dce29b76c64e93c56c01fa5020860f935ed3\/starlette\/templating.py#L123\">\u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430 Jinja<\/a>.<\/p>\n<h3>TL;DR<\/h3>\n<p> \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0432 FastAPI, \u0438 \u043e\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0443\u0442\u0438, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u0441\u0442\u0435\u043a \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 FastAPI \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u043b\u043e\u0433\u0438\u043a\u0438. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u044b \u043a \u0433\u0440\u0443\u043f\u043f\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u043e\u0432. \u0417\u0430\u0442\u0435\u043c \u044d\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 Starlette, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0443\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u044b Jinja \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438. \u0418\u043c\u0435\u043d\u043d\u043e \u0441 \u044d\u0442\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0432\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0435! <\/p>\n<p> P.S. \u041e\u0431\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u0430\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 <a href=\"https:\/\/habr.com\/ru\/companies\/piter\/articles\/873340\/\">\u0440\u0430\u0441\u043f\u0440\u043e\u0434\u0430\u0436\u0430<\/a>.<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/876378\/\"> https:\/\/habr.com\/ru\/articles\/876378\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 Python, \u0432\u044b\u0441\u043e\u043a\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 FastAPI. \u0412 FastAPI \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441 \u043d\u0438\u043c \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443. \u041d\u043e \u0432 FastAPI \u0435\u0441\u0442\u044c \u0438 \u043d\u0435\u043c\u0430\u043b\u043e \u043d\u044e\u0430\u043d\u0441\u043e\u0432, \u043d\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f. \u041c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043f\u043e\u0442\u0435\u0442\u044c \u0441 \u043e\u0434\u043d\u0438\u043c \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u043c, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2014 \u043a\u0430\u043a FastAPI \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438 \u043a \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430\u043c API <a href=\"https:\/\/fastapi.tiangolo.com\/tutorial\/path-params\/\">\u0447\u0435\u0440\u0435\u0437 \u0434\u0435\u043a\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0443\u0442\u0438<\/a>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c.<\/p>\n<h3>\u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/h3>\n<p> \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0432\u0430\u0436\u043d\u0435\u0439\u0448\u0438\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043b\u044e\u0431\u043e\u0433\u043e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/newsletter.vickiboykis.com\/archive\/when-you-write-a-web-server-but-you-get-served\/\">\u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440<\/a>, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u0441\u043b\u0443\u0448\u0430\u044e\u0449\u0430\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u044e\u0449\u0438\u0435 \u0438\u0437 \u0441\u0435\u0442\u0438. \u0417\u0430\u0442\u0435\u043c \u043e\u043d\u0430 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u0431\u044d\u043a\u0435\u043d\u0434\u0435.<\/p>\n<p> \u0427\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c <code>http.server<\/code>, <a href=\"https:\/\/github.com\/python\/cpython\/blob\/main\/Lib\/http\/server.py\">\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 Python<\/a>.<\/p>\n<p> \u041d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043b\u0443\u0448\u0430\u0435\u0442 \u043f\u043e\u0440\u0442 \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0410 \u0438\u043c\u0435\u043d\u043d\u043e: \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043f\u0443\u0442\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0451\u043d\u043d\u044b\u0435 \u043a HTTP-\u0432\u044b\u0437\u043e\u0432\u0443. \u0421\u043c. \u0442\u0430\u043a\u0436\u0435 \u201c<a href=\"https:\/\/crawshaw.io\/blog\/programming-with-llms\">All I want is to cURL and parse a JSON object<\/a>\u201d. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-446087","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/446087","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=446087"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/446087\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=446087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=446087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=446087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}