{"id":395525,"date":"2024-06-29T12:16:24","date_gmt":"2024-06-29T12:16:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=395525"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T12:16:24","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=395525","title":{"rendered":"<span>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0421leanAPI: c\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 Python \u0437\u0430 30 \u0441\u0435\u043a\u0443\u043d\u0434<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432\u0437\u0430\u043c\u0435\u043d \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0439 \u2014 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0442\u0440\u0435\u043d\u0434 \u0432 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. <\/p>\n<p>\u042f \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u043b \u0446\u0435\u043b\u044c\u044e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0435\u0439 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0416\u0435\u043b\u0430\u044e\u0449\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u0449\u0435\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u043c\u0443 \u043c\u043e\u0433\u0443 \u043f\u043e\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c  \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/company\/mailru\/blog\/320962\/\" rel=\"noopener noreferrer nofollow\">\u0441\u044e\u0434\u0430<\/a>.<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0440\u0435\u0448\u0438\u0442\u044c, \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0432\u0448\u0438\u0441\u044c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 Python \u2014 \u0432\u044b\u0431\u043e\u0440 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u041c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e,  \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0433\u0430\u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 Django, \u043d\u043e, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u044d\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e, \u0447\u0442\u043e \u0437\u0430\u0431\u0438\u0432\u0430\u0442\u044c \u0433\u0432\u043e\u0437\u0434\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0433\u0438\u0434\u0440\u043e\u043c\u043e\u043b\u043e\u0442\u0430. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0435 \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0432 \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0431\u044b\u0441\u0442\u0440\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 API: <a href=\"https:\/\/flask.palletsprojects.com\/en\/2.0.x\/\" rel=\"noopener noreferrer nofollow\">Flask<\/a>, <a href=\"https:\/\/www.tornadoweb.org\/en\/stable\/\" rel=\"noopener noreferrer nofollow\">Tornado<\/a>, <a href=\"https:\/\/fastapi.tiangolo.com\/\" rel=\"noopener noreferrer nofollow\">FastAPI<\/a> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435.  <\/p>\n<p>\u041c\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 \u2014 <a href=\"https:\/\/www.tornadoweb.org\/en\/stable\/\" rel=\"noopener noreferrer nofollow\">Tornado<\/a>. \u041e\u043d \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0440\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u2014 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439. \u0420\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 2009 \u0433\u043e\u0434\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0431\u043e\u043b\u0435\u043b \u0432\u0441\u0435\u043c\u0438 \u0434\u0435\u0442\u0441\u043a\u0438\u043c\u0438 \u0431\u043e\u043b\u0435\u0437\u043d\u044f\u043c\u0438 \u0438 \u043d\u0435 \u043f\u0440\u0435\u043f\u043e\u0434\u043d\u043e\u0441\u0438\u0442 \u0441\u044e\u0440\u043f\u0440\u0438\u0437\u043e\u0432 \u0441 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u043d\u043e\u0432\u044b\u0445 \u0440\u0435\u043b\u0438\u0437\u043e\u0432. \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439 \u0432 \u0441\u0435\u0442\u0438 \u043f\u043e \u043d\u0435\u043c\u0443 \u043d\u0430\u043a\u043e\u043f\u0438\u043b\u043e\u0441\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e, \u0442\u0430\u043a \u0447\u0442\u043e, \u043e\u0441\u0432\u0430\u0438\u0432\u0430\u044f \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0432\u044b \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0435\u0441\u044c \u043e\u0434\u0438\u043d \u043d\u0430 \u043e\u0434\u0438\u043d \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438.<\/p>\n<p>\u041f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0432 \u0441 Tornado \u0432 \u043f\u0430\u0440\u0435 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u044f \u0432 \u0446\u0435\u043b\u043e\u043c \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u0435\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u0431\u044b \u043d\u0438 \u0431\u044b\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u0432\u0441\u0435\u0433\u0434\u0430 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0447\u0435\u0433\u043e-\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u044f \u0432\u0432\u043e\u0436\u0443 \u043d\u043e\u0432\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0432 \u043a\u0443\u0440\u0441 \u0434\u0435\u043b\u0430, \u043c\u0435\u043d\u044f \u0441\u043b\u0435\u0433\u043a\u0430 \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043c \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0433\u0434\u0435 \u0447\u0442\u043e \u043b\u0435\u0436\u0438\u0442 \u0438 \u043a\u0443\u0434\u0430 \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u043e\u0447\u043a\u0443 \u0432\u0445\u043e\u0434\u0430. \u041d\u0435\u0442, \u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u0441\u044e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435, \u043d\u043e \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0443\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u00abHello world!\u00bb, \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u043c. \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u0442\u0430\u043a: \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0445\u044d\u043d\u0434\u043b\u0435\u0440, \u0431\u0440\u043e\u0441\u0438\u043b \u0432 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0438 \u0437\u0430\u0431\u044b\u043b \u2014 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0430\u043c \u0435\u0433\u043e \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u0438\u0442 \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0439 \u0430\u0434\u0440\u0435\u0441 \u0435\u043c\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c. \u0422\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0438 \u0432 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u0415\u0449\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u0434\u0430\u0442\u0430\u043a\u043b\u0430\u0441\u0441\u043e\u0432 Pydantic (\u043a\u0430\u043a \u0443 FastAPI), \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 http \u0438 https, \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438\u043d\u0433\u0430 \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u043c\u0435\u043b\u043e\u0447\u0435\u0439.<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043c\u043e\u0438\u0445 \u0440\u0430\u0437\u0434\u0443\u043c\u0438\u0439 \u0441\u0442\u0430\u043b\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/github.com\/vlakir\/cleanapi\" rel=\"noopener noreferrer nofollow\">CleanAPI<\/a>, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u0441\u043e\u0431\u043e\u0439 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443 \u043d\u0430\u0434 Tornado, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0443\u044e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0434\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u0430 \u0438 \u0431\u0435\u0437 \u0442\u043e\u0433\u043e \u043d\u0435\u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432. <\/p>\n<p>CleanAPI \u2014 \u043d\u0435 \u0444\u043e\u0440\u043a Tornado, \u0430 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0430 \u043d\u0430\u0434 \u043d\u0438\u043c. \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u044f \u043e\u0442 \u0441\u0435\u0431\u044f \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u2014 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0445\u0430\u0440. <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443:<\/p>\n<pre><code class=\"bash\">pip install cleanapi<\/code><\/pre>\n<p>\u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Tornado \u043f\u043e\u0434\u0442\u044f\u043d\u0435\u0442\u0441\u044f \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f &#171;\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442&#187; \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0430\u043f\u043e\u043a:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/250\/c9b\/1af\/250c9b1af920ea1bba44df33645ea63d.png\" width=\"215\" height=\"152\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/250\/c9b\/1af\/250c9b1af920ea1bba44df33645ea63d.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0445\u044d\u043d\u0434\u043b\u0435\u0440 simple_handler.py:<\/p>\n<pre><code class=\"python\">from cleanapi.server import BaseHandler  url_tail = '\/example.json'  class Handler(BaseHandler):     async def get(self):         self.set_status(200)         self.write({'status': 'working'})<\/code><\/pre>\n<p>\u041f\u0438\u0448\u0435\u043c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0443 index.html, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u0443\u044e:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;head>   &lt;meta charset=\"utf-8\">   &lt;title>\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f CleanAPI&lt;\/title>   &lt;link rel=\"icon\" href=\"\/favicon.ico\" type=\"image\/x-icon\" \/>  &lt;\/head> &lt;body> &lt;h1>\u0414\u0435\u043c\u043e-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430&lt;\/h1> &lt;p>\u0412\u0441\u0435 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435!&lt;\/p> &lt;\/body> &lt;\/html><\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0435\u0440\u0444\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0441\u0442, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0435\u0449\u0435 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0443 static_html \u0438\u043a\u043e\u043d\u043a\u0443 favicon.ico<\/p>\n<p>\u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0438\u0448\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 server_example.py:<\/p>\n<pre><code class=\"python\">from cleanapi import server  server.start('http', 8080, '\/', '.\/handlers', '.\/static_html')<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043b\u044e\u0431\u0443\u0435\u043c\u0441\u044f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c:  <\/p>\n<p><a href=\"http:\/\/localhost:8080\/\" rel=\"noopener noreferrer nofollow\">http:\/\/localhost:8080<\/a><\/p>\n<p><a href=\"http:\/\/localhost:8080\/example.json\" rel=\"noopener noreferrer nofollow\">http:\/\/localhost:8080\/example.json<\/a><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0432 \u043f\u0430\u043f\u043a\u0435 log \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043b\u043e\u0433-\u0444\u0430\u0439\u043b.<\/p>\n<p>\u041f\u043e\u0447\u0442\u0438 \u0441\u0442\u043e\u043b\u044c \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u0442\u0430\u043a\u043b\u0430\u0441\u0441\u043e\u0432 Pydantic. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0435 handlers \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a pydantic_handler.py:<\/p>\n<pre><code class=\"python\">from cleanapi.server import PydanticHandler from pydantic import BaseModel, validator, NonNegativeInt from typing import Optional, List   url_tail = '\/pydantic.json'   class PydanticRequest(BaseModel):     foo: NonNegativeInt     bar: NonNegativeInt      @validator('foo', 'bar')     def _validate_foo_bar(cls, val: str):         if val == 666:             raise ValueError(f'Values of foo and bar should not be equal to 666')         return val   class PydanticResponse(BaseModel):     summ: Optional[NonNegativeInt]     errors: Optional[List[dict]]   class Handler(PydanticHandler):     request_dataclass = PydanticRequest     result_dataclass = PydanticResponse      def process(self, request: request_dataclass) -> result_dataclass:         result = PydanticResponse(summ=request.foo + request.bar, errors=[])          if result.summ > 1000:             raise ValueError('The sum of foo and bar is more than 1000')          return result      def if_exception(self, errors: list) -> None:         self.set_status(400)         self.write({'errors': errors})         return<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443: <a href=\"http:\/\/localhost:8080\/pydantic.json\" rel=\"noopener noreferrer nofollow\">http:\/\/localhost:8080\/pydantic.json<\/a><\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0434\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u043c POST \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 json. \u0411\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u0442\u0438\u043f\u0430 Postman \u0438\u043b\u0438 \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u0440\u043e\u0434\u0435:<\/p>\n<pre><code class=\"python\">import requests import json import urllib3 from funnydeco import benchmark  urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) host = 'http:\/\/localhost:8080' url_pydantic = f'{host}\/pydantic.json' headers = {'Content-type': 'application\/json'}  params_pydantic = {                      \"foo\": 8,                      \"bar\": 4                    } @benchmark def requester(url: str, params: dict, print_benchmark=False, benchmark_name='') -> None:     response = requests.post(url, verify=False, data=json.dumps(params), headers=headers)     print('Server response:')     print(f'Status code - {response.status_code}')     print(json.dumps(response.json(), sort_keys=False, indent=4, ensure_ascii=False))  if __name__ == '__main__':     print_bench = True     bench_name = 'Request execution'     requester(url_pydantic, params_pydantic, print_benchmark=print_bench, benchmark_name=bench_name)<\/code><\/pre>\n<p>\u041f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 foo \u0438 bar, \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u043b\u043e\u0433\u0438\u043a\u0430, \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435,  \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u043d\u0430\u0434\u043e.<\/p>\n<p>\u0414\u043b\u044f \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a \u0432\u0430\u0448\u0435\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u0445\u044d\u043d\u0434\u043b\u0435\u0440\u043e\u0432, \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0432 \u0438\u0445 \u043e\u0442 BaseHandler \u0438\u043b\u0438 PydanticHandler.<\/p>\n<p>\u0412 \u0441\u0432\u043e\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430 \u0441\u0447\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u044b \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u043a\u043e\u0434\u0430 API-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u0430 \u043e\u043d \u0431\u044b\u043b \u043d\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0431\u043e\u043b\u0435\u0435 20 \u0442\u043e\u0447\u0435\u043a \u0432\u0445\u043e\u0434\u0430) \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0432 \u0442\u0440\u0438 \u0440\u0430\u0437\u0430.  <\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c, \u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u0435. \u041f\u0440\u0438\u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u0441\u0432\u043e\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0444\u0438\u0448\u043a\u0438 \u2014 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u043f\u0443\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u044b \u043d\u0430 <a href=\"https:\/\/github.com\/vlakir\/cleanapi\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/vlakir\/cleanapi<\/a>.<\/p>\n<p>\u0412\u0441\u0435\u043c \u0434\u043e\u0431\u0440\u0430!<\/p>\n<\/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\/574998\/\"> https:\/\/habr.com\/ru\/articles\/574998\/<\/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-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043a\u043e\u0440\u043f\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432\u0437\u0430\u043c\u0435\u043d \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u043e\u0439 \u2014 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0442\u0440\u0435\u043d\u0434 \u0432 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435. <\/p>\n<p>\u042f \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u043b \u0446\u0435\u043b\u044c\u044e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0435\u0439 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0416\u0435\u043b\u0430\u044e\u0449\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u0449\u0435\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u043c\u0443 \u043c\u043e\u0433\u0443 \u043f\u043e\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c  \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c <a href=\"https:\/\/habr.com\/ru\/company\/mailru\/blog\/320962\/\" rel=\"noopener noreferrer nofollow\">\u0441\u044e\u0434\u0430<\/a>.<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0440\u0435\u0448\u0438\u0442\u044c, \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0432\u0448\u0438\u0441\u044c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 Python \u2014 \u0432\u044b\u0431\u043e\u0440 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u041c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e,  \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0433\u0430\u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 Django, \u043d\u043e, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u044d\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e, \u0447\u0442\u043e \u0437\u0430\u0431\u0438\u0432\u0430\u0442\u044c \u0433\u0432\u043e\u0437\u0434\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0433\u0438\u0434\u0440\u043e\u043c\u043e\u043b\u043e\u0442\u0430. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0435 \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0432 \u043e\u0441\u0432\u043e\u0435\u043d\u0438\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0431\u044b\u0441\u0442\u0440\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 API: <a href=\"https:\/\/flask.palletsprojects.com\/en\/2.0.x\/\" rel=\"noopener noreferrer nofollow\">Flask<\/a>, <a href=\"https:\/\/www.tornadoweb.org\/en\/stable\/\" rel=\"noopener noreferrer nofollow\">Tornado<\/a>, <a href=\"https:\/\/fastapi.tiangolo.com\/\" rel=\"noopener noreferrer nofollow\">FastAPI<\/a> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435.  <\/p>\n<p>\u041c\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 \u2014 <a href=\"https:\/\/www.tornadoweb.org\/en\/stable\/\" rel=\"noopener noreferrer nofollow\">Tornado<\/a>. \u041e\u043d \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0440\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u2014 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439. \u0420\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 2009 \u0433\u043e\u0434\u0430, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0431\u043e\u043b\u0435\u043b \u0432\u0441\u0435\u043c\u0438 \u0434\u0435\u0442\u0441\u043a\u0438\u043c\u0438 \u0431\u043e\u043b\u0435\u0437\u043d\u044f\u043c\u0438 \u0438 \u043d\u0435 \u043f\u0440\u0435\u043f\u043e\u0434\u043d\u043e\u0441\u0438\u0442 \u0441\u044e\u0440\u043f\u0440\u0438\u0437\u043e\u0432 \u0441 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u043d\u043e\u0432\u044b\u0445 \u0440\u0435\u043b\u0438\u0437\u043e\u0432. \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0439 \u0432 \u0441\u0435\u0442\u0438 \u043f\u043e \u043d\u0435\u043c\u0443 \u043d\u0430\u043a\u043e\u043f\u0438\u043b\u043e\u0441\u044c \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e, \u0442\u0430\u043a \u0447\u0442\u043e, \u043e\u0441\u0432\u0430\u0438\u0432\u0430\u044f \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0432\u044b \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0435\u0441\u044c \u043e\u0434\u0438\u043d \u043d\u0430 \u043e\u0434\u0438\u043d \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438.<\/p>\n<p>\u041f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0432 \u0441 Tornado \u0432 \u043f\u0430\u0440\u0435 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u044f \u0432 \u0446\u0435\u043b\u043e\u043c \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u0435\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u0431\u044b \u043d\u0438 \u0431\u044b\u043b\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u0432\u0441\u0435\u0433\u0434\u0430 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0447\u0435\u0433\u043e-\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0433\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u044f \u0432\u0432\u043e\u0436\u0443 \u043d\u043e\u0432\u044b\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0432 \u043a\u0443\u0440\u0441 \u0434\u0435\u043b\u0430, \u043c\u0435\u043d\u044f \u0441\u043b\u0435\u0433\u043a\u0430 \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043c \u043c\u043d\u043e\u0433\u043e\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0433\u0434\u0435 \u0447\u0442\u043e \u043b\u0435\u0436\u0438\u0442 \u0438 \u043a\u0443\u0434\u0430 \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u043e\u0447\u043a\u0443 \u0432\u0445\u043e\u0434\u0430. \u041d\u0435\u0442, \u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u0441\u044e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435, \u043d\u043e \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0443\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u00abHello world!\u00bb, \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u043c. \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u0442\u0430\u043a: \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0445\u044d\u043d\u0434\u043b\u0435\u0440, \u0431\u0440\u043e\u0441\u0438\u043b \u0432 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 \u0438 \u0437\u0430\u0431\u044b\u043b \u2014 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0430\u043c \u0435\u0433\u043e \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u0438\u0442 \u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0439 \u0430\u0434\u0440\u0435\u0441 \u0435\u043c\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c. \u0422\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0438 \u0432 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u0415\u0449\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb \u0434\u0430\u0442\u0430\u043a\u043b\u0430\u0441\u0441\u043e\u0432 Pydantic (\u043a\u0430\u043a \u0443 FastAPI), \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 http \u0438 https, \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0438\u043d\u0433\u0430 \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u043c\u0435\u043b\u043e\u0447\u0435\u0439.<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043c\u043e\u0438\u0445 \u0440\u0430\u0437\u0434\u0443\u043c\u0438\u0439 \u0441\u0442\u0430\u043b\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <a href=\"https:\/\/github.com\/vlakir\/cleanapi\" rel=\"noopener noreferrer nofollow\">CleanAPI<\/a>, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0430\u044f \u0441\u043e\u0431\u043e\u0439 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443 \u043d\u0430\u0434 Tornado, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0443\u044e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0434\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u0430 \u0438 \u0431\u0435\u0437 \u0442\u043e\u0433\u043e \u043d\u0435\u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u043f\u043e\u0440\u043e\u0433 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432. <\/p>\n<p>CleanAPI \u2014 \u043d\u0435 \u0444\u043e\u0440\u043a Tornado, \u0430 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0430 \u043d\u0430\u0434 \u043d\u0438\u043c. \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u044f \u043e\u0442 \u0441\u0435\u0431\u044f \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u2014 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0445\u0430\u0440. <\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443:<\/p>\n<pre><code class=\"bash\">pip install cleanapi<\/code><\/pre>\n<p>\u0410\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Tornado \u043f\u043e\u0434\u0442\u044f\u043d\u0435\u0442\u0441\u044f \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f &#171;\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442&#187; \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043f\u0430\u043f\u043e\u043a:<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0445\u044d\u043d\u0434\u043b\u0435\u0440 simple_handler.py:<\/p>\n<pre><code class=\"python\">from cleanapi.server import BaseHandler  url_tail = '\/example.json'  class Handler(BaseHandler):     async def get(self):         self.set_status(200)         self.write({'status': 'working'})<\/code><\/pre>\n<p>\u041f\u0438\u0448\u0435\u043c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0443 index.html, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u0443\u044e:<\/p>\n<pre><code class=\"xml\">&lt;!DOCTYPE html> &lt;html> &lt;head>   &lt;meta charset=\"utf-8\">   &lt;title>\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f CleanAPI&lt;\/title>   &lt;link rel=\"icon\" href=\"\/favicon.ico\" type=\"image\/x-icon\" \/>  &lt;\/head> &lt;body> &lt;h1>\u0414\u0435\u043c\u043e-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430&lt;\/h1> &lt;p>\u0412\u0441\u0435 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435!&lt;\/p> &lt;\/body> &lt;\/html><\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0435\u0440\u0444\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0441\u0442, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0435\u0449\u0435 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0443 static_html \u0438\u043a\u043e\u043d\u043a\u0443 favicon.ico<\/p>\n<p>\u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0438\u0448\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 server_example.py:<\/p>\n<pre><code class=\"python\">from cleanapi import server  server.start('http', 8080, '\/', '.\/handlers', '.\/static_html')<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043b\u044e\u0431\u0443\u0435\u043c\u0441\u044f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c:  <\/p>\n<p><a href=\"http:\/\/localhost:8080\/\" rel=\"noopener noreferrer nofollow\">http:\/\/localhost:8080<\/a><\/p>\n<p><a href=\"http:\/\/localhost:8080\/example.json\" rel=\"noopener noreferrer nofollow\">http:\/\/localhost:8080\/example.json<\/a><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0432 \u043f\u0430\u043f\u043a\u0435 log \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043b\u043e\u0433-\u0444\u0430\u0439\u043b.<\/p>\n<p>\u041f\u043e\u0447\u0442\u0438 \u0441\u0442\u043e\u043b\u044c \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0442\u0430\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u0442\u0430\u043a\u043b\u0430\u0441\u0441\u043e\u0432 Pydantic. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u043f\u0430\u043f\u043a\u0435 handlers \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a pydantic_handler.py:<\/p>\n<pre><code class=\"python\">from cleanapi.server import PydanticHandler from pydantic import BaseModel, validator, NonNegativeInt from typing import Optional, List   url_tail = '\/pydantic.json'   class PydanticRequest(BaseModel):     foo: NonNegativeInt     bar: NonNegativeInt      @validator('foo', 'bar')     def _validate_foo_bar(cls, val: str):         if val == 666:             raise ValueError(f'Values of foo and bar should not be equal to 666')         return val   class PydanticResponse(BaseModel):     summ: Optional[NonNegativeInt]     errors: Optional[List[dict]]   class Handler(PydanticHandler):     request_dataclass = PydanticRequest     result_dataclass = PydanticResponse      def process(self, request: request_dataclass) -> result_dataclass:         result = PydanticResponse(summ=request.foo + request.bar, errors=[])          if result.summ > 1000:             raise ValueError('The sum of foo and bar is more than 1000')          return result      def if_exception(self, errors: list) -> None:         self.set_status(400)         self.write({'errors': errors})         return<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443: <a href=\"http:\/\/localhost:8080\/pydantic.json\" rel=\"noopener noreferrer nofollow\">http:\/\/localhost:8080\/pydantic.json<\/a><\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0434\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u043c POST \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 json. \u0411\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u0442\u0438\u043f\u0430 Postman \u0438\u043b\u0438 \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u0440\u043e\u0434\u0435:<\/p>\n<pre><code class=\"python\">import requests import json import urllib3 from funnydeco import benchmark  urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) host = 'http:\/\/localhost:8080' url_pydantic = f'{host}\/pydantic.json' headers = {'Content-type': 'application\/json'}  params_pydantic = {                      \"foo\": 8,                      \"bar\": 4                    } @benchmark def requester(url: str, params: dict, print_benchmark=False, benchmark_name='') -> None:     response = requests.post(url, verify=False, data=json.dumps(params), headers=headers)     print('Server response:')     print(f'Status code - {response.status_code}')     print(json.dumps(response.json(), sort_keys=False, indent=4, ensure_ascii=False))  if __name__ == '__main__':     print_bench = True     bench_name = 'Request execution'     requester(url_pydantic, params_pydantic, print_benchmark=print_bench, benchmark_name=bench_name)<\/code><\/pre>\n<p>\u041f\u043e\u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 foo \u0438 bar, \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u043b\u043e\u0433\u0438\u043a\u0430, \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435,  \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u043d\u0430\u0434\u043e.<\/p>\n<p>\u0414\u043b\u044f \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a \u0432\u0430\u0448\u0435\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u0445\u044d\u043d\u0434\u043b\u0435\u0440\u043e\u0432, \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0432 \u0438\u0445 \u043e\u0442 BaseHandler \u0438\u043b\u0438 PydanticHandler.<\/p>\n<p>\u0412 \u0441\u0432\u043e\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043c\u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430 \u0441\u0447\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u044b \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u043a\u043e\u0434\u0430 API-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u0430 \u043e\u043d \u0431\u044b\u043b \u043d\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0431\u043e\u043b\u0435\u0435 20 \u0442\u043e\u0447\u0435\u043a \u0432\u0445\u043e\u0434\u0430) \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u0432 \u0442\u0440\u0438 \u0440\u0430\u0437\u0430.  <\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c, \u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u0437\u0434\u043e\u0440\u043e\u0432\u044c\u0435. \u041f\u0440\u0438\u0434\u0443\u043c\u0430\u0435\u0442\u0435 \u0441\u0432\u043e\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0444\u0438\u0448\u043a\u0438 \u2014 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u043f\u0443\u043b-\u0440\u0435\u043a\u0432\u0435\u0441\u0442\u044b \u043d\u0430 <a href=\"https:\/\/github.com\/vlakir\/cleanapi\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/vlakir\/cleanapi<\/a>.<\/p>\n<p>\u0412\u0441\u0435\u043c \u0434\u043e\u0431\u0440\u0430!<\/p>\n<\/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\/574998\/\"> https:\/\/habr.com\/ru\/articles\/574998\/<\/a><br \/><\/br><\/br><\/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-395525","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/395525","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=395525"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/395525\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=395525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=395525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=395525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}