{"id":10920,"date":"2025-04-18T18:18:28","date_gmt":"2025-04-18T10:18:28","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/10920.html"},"modified":"2025-04-18T18:18:28","modified_gmt":"2025-04-18T10:18:28","slug":"%e3%80%90python%e3%80%91uvicorn%ef%bc%9apython-%e5%bc%82%e6%ad%a5-asgi-%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/10920.html","title":{"rendered":"\u3010Python\u3011Uvicorn\uff1aPython \u5f02\u6b65 ASGI \u670d\u52a1\u5668\u8be6\u89e3"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101826-680226f2384b0.gif\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>Uvicorn \u662f\u4e00\u4e2a\u4e3a Python \u8bbe\u8ba1\u7684 ASGI&#xff08;\u5f02\u6b65\u670d\u52a1\u5668\u7f51\u5173\u63a5\u53e3&#xff09;Web \u670d\u52a1\u5668\u3002\u5b83\u586b\u8865\u4e86 Python \u5728\u5f02\u6b65\u6846\u67b6\u4e2d\u7f3a\u4e4f\u4e00\u4e2a\u6700\u5c0f\u5316\u4f4e\u5c42\u6b21\u670d\u52a1\u5668\/\u5e94\u7528\u63a5\u53e3\u7684\u7a7a\u767d\u3002Uvicorn \u652f\u6301 HTTP\/1.1 \u548c WebSockets&#xff0c;\u662f\u6784\u5efa\u73b0\u4ee3\u5f02\u6b65Web\u5e94\u7528\u7684\u5f3a\u5927\u5de5\u5177\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101826-680226f251a87.jpg\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101826-680226f2cf545.gif\" alt=\"\u534e\u4e3d\u7684\u5206\u5272\u7ebf\" \/><\/p>\n<\/p>\n<h4>\u2b55\ufe0f\u5b87\u5b99\u8d77\u70b9<\/h4>\n<ul>\n<li>\n<ul>\n<li>&#x1f3ac; \u4ec0\u4e48\u662f Uvicorn&#xff1f;<\/li>\n<li>&#x1f528; Uvicorn \u7684\u4e3b\u8981\u529f\u80fd\u548c\u7279\u6027<\/li>\n<li>&#x1f4e6; Uvicorn \u7684\u5e38\u7528\u542f\u52a8\u53c2\u6570<\/li>\n<li>\u2668\ufe0f \u793a\u4f8b&#xff1a;\u4f7f\u7528 &#096;uvicorn.run&#096; \u542f\u52a8 ASGI \u5e94\u7528<\/li>\n<li>\u2699\ufe0f \u8fd0\u884c Uvicorn \u7684\u9ad8\u7ea7\u914d\u7f6e<\/li>\n<li>&#x1f527; \u4f7f\u7528 Gunicorn \u90e8\u7f72 Uvicorn<\/li>\n<li>&#x1f4e5; \u4e0b\u8f7d\u5730\u5740<\/li>\n<li>&#x1f4ac; \u7ed3\u8bed<\/li>\n<li>\n<ul>\n<li>&#x1f4d2; \u53c2\u8003\u6587\u732e<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101826-680226f2dad5c.png\" alt=\"\u6807\u98981\" height=\"45\" \/><\/p>\n<h3>&#x1f3ac; \u4ec0\u4e48\u662f Uvicorn&#xff1f;<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101826-680226f2e6243.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>Uvicorn \u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u3001\u9ad8\u6027\u80fd\u7684 ASGI&#xff08;Asynchronous Server Gateway Interface&#xff09; \u670d\u52a1\u5668&#xff0c;\u4e13\u4e3a\u652f\u6301 Python \u5f02\u6b65\u6846\u67b6&#xff08;\u5982 FastAPI \u548c Starlette&#xff09;\u800c\u8bbe\u8ba1\u3002\u4e0e\u4f20\u7edf\u7684 WSGI \u670d\u52a1\u5668&#xff08;\u5982 Gunicorn&#xff09;\u4e0d\u540c&#xff0c;Uvicorn \u65e8\u5728\u63d0\u4f9b\u5bf9\u5f02\u6b65 Web \u6846\u67b6\u7684\u5b8c\u5168\u652f\u6301&#xff0c;\u5e76\u5728\u6027\u80fd\u548c\u7075\u6d3b\u6027\u65b9\u9762\u8fdb\u884c\u4e86\u5927\u91cf\u4f18\u5316\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101827-680226f30d7b8.png\" alt=\"\u6807\u98982\" height=\"45\" \/><\/p>\n<h3>&#x1f528; Uvicorn \u7684\u4e3b\u8981\u529f\u80fd\u548c\u7279\u6027<\/h3>\n<ul>\n<li>\u9ad8\u6027\u80fd&#xff1a;Uvicorn \u4f7f\u7528 uvloop \u4f5c\u4e3a\u9ed8\u8ba4\u7684\u4e8b\u4ef6\u5faa\u73af\u548c httptools \u8fdb\u884c HTTP \u89e3\u6790&#xff0c;\u56e0\u6b64\u6bd4\u4f20\u7edf\u7684 Python \u670d\u52a1\u5668\u66f4\u5feb\u3002<\/li>\n<li>\u652f\u6301\u591a\u79cd\u534f\u8bae&#xff1a;\u652f\u6301 HTTP \u548c WebSocket \u534f\u8bae&#xff0c;\u5e76\u53ef\u914d\u7f6e ASGI 2 \u6216 ASGI 3 \u63a5\u53e3\u3002<\/li>\n<li>\u914d\u7f6e\u7075\u6d3b&#xff1a;\u652f\u6301\u901a\u8fc7\u547d\u4ee4\u884c\u53c2\u6570\u3001\u73af\u5883\u53d8\u91cf\u6216\u914d\u7f6e\u6587\u4ef6\u8fdb\u884c\u8be6\u7ec6\u7684\u670d\u52a1\u5668\u914d\u7f6e\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101827-680226f318647.png\" alt=\"\u6807\u98983\" height=\"45\" \/><\/p>\n<h3>&#x1f4e6; Uvicorn \u7684\u5e38\u7528\u542f\u52a8\u53c2\u6570<\/h3>\n<p>\u5728\u4f7f\u7528 Uvicorn \u542f\u52a8 ASGI \u5e94\u7528\u65f6&#xff0c;\u901a\u5e38\u901a\u8fc7\u547d\u4ee4\u884c\u4f20\u9012\u5404\u79cd\u53c2\u6570\u4ee5\u63a7\u5236\u5176\u884c\u4e3a\u3002\u4e0b\u9762\u5217\u51fa\u4e86\u51e0\u4e2a\u5e38\u7528\u7684\u542f\u52a8\u53c2\u6570\u53ca\u5176\u7528\u9014&#xff1a;<\/p>\n<table>\n<tr>\u53c2\u6570\u4f5c\u7528\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td>&#8211;host<\/td>\n<td>\u6307\u5b9a\u7ed1\u5b9a\u7684\u4e3b\u673a\u5730\u5740<\/td>\n<td>&#8211;host 127.0.0.1<\/td>\n<\/tr>\n<tr>\n<td>&#8211;port<\/td>\n<td>\u6307\u5b9a\u7aef\u53e3\u53f7<\/td>\n<td>&#8211;port 8000<\/td>\n<\/tr>\n<tr>\n<td>&#8211;workers<\/td>\n<td>\u6307\u5b9a\u5de5\u4f5c\u8fdb\u7a0b\u6570<\/td>\n<td>&#8211;workers 4<\/td>\n<\/tr>\n<tr>\n<td>&#8211;reload<\/td>\n<td>\u542f\u7528\u81ea\u52a8\u91cd\u8f7d&#xff0c;\u5728\u5f00\u53d1\u65f6\u81ea\u52a8\u68c0\u6d4b\u6587\u4ef6\u53d8\u52a8\u5e76\u91cd\u542f\u670d\u52a1\u5668<\/td>\n<td>&#8211;reload<\/td>\n<\/tr>\n<tr>\n<td>&#8211;log-level<\/td>\n<td>\u65e5\u5fd7\u7b49\u7ea7&#xff08;info\u3001debug\u3001error&#xff09;<\/td>\n<td>&#8211;log-level debug<\/td>\n<\/tr>\n<tr>\n<td>&#8211;ssl-keyfile<\/td>\n<td>SSL \u5bc6\u94a5\u6587\u4ef6\u8def\u5f84<\/td>\n<td>&#8211;ssl-keyfile .\/path\/to\/key.pem<\/td>\n<\/tr>\n<tr>\n<td>&#8211;ssl-certfile<\/td>\n<td>SSL \u8bc1\u4e66\u6587\u4ef6\u8def\u5f84<\/td>\n<td>&#8211;ssl-certfile .\/path\/to\/cert.pem<\/td>\n<\/tr>\n<tr>\n<td>&#8211;backlog<\/td>\n<td>\u8bbe\u7f6e\u8fde\u63a5\u8bf7\u6c42\u7684\u6700\u5927\u7b49\u5f85\u961f\u5217\u6570<\/td>\n<td>&#8211;backlog 2048<\/td>\n<\/tr>\n<tr>\n<td>&#8211;limit-max-requests<\/td>\n<td>\u9650\u5236\u5355\u4e2a\u8fdb\u7a0b\u5728\u91cd\u542f\u524d\u53ef\u5904\u7406\u7684\u6700\u5927\u8bf7\u6c42\u6570<\/td>\n<td>&#8211;limit-max-requests 1000<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u4e9b\u53c2\u6570\u53ef\u4ee5\u7075\u6d3b\u5730\u7ec4\u5408\u4f7f\u7528&#xff0c;\u6839\u636e\u9700\u8981\u914d\u7f6e Uvicorn \u7684\u8fd0\u884c\u884c\u4e3a\u3002\u7279\u522b\u662f\u5bf9\u4e8e\u751f\u4ea7\u73af\u5883&#xff0c;\u53ef\u4ee5\u642d\u914d &#8211;workers \u53c2\u6570\u6765\u542f\u52a8\u591a\u4e2a\u8fdb\u7a0b&#xff0c;\u63d0\u9ad8\u5e76\u53d1\u5904\u7406\u80fd\u529b\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101827-680226f323b24.png\" alt=\"\u6807\u98984\" height=\"45\" \/><\/p>\n<h3>\u2668\ufe0f \u793a\u4f8b&#xff1a;\u4f7f\u7528 uvicorn.run \u542f\u52a8 ASGI \u5e94\u7528<\/h3>\n<p>Uvicorn \u65e2\u53ef\u4ee5\u4ece\u547d\u4ee4\u884c\u542f\u52a8&#xff0c;\u4e5f\u53ef\u4ee5\u901a\u8fc7 Python \u4ee3\u7801\u8fdb\u884c\u542f\u52a8\u3002\u4ee5\u4e0b\u662f\u51e0\u79cd\u4e0d\u540c\u7684\u542f\u52a8\u65b9\u5f0f&#xff1a;<\/p>\n<p>1&#xff09;\u4f7f\u7528 uvicorn.run() \u542f\u52a8<\/p>\n<p><span class=\"token keyword\">import<\/span> uvicorn<\/p>\n<p><span class=\"token keyword\">async<\/span> <span class=\"token keyword\">def<\/span> <span class=\"token function\">app<\/span><span class=\"token punctuation\">(<\/span>scope<span class=\"token punctuation\">,<\/span> receive<span class=\"token punctuation\">,<\/span> send<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">assert<\/span> scope<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#039;type&#039;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#039;http&#039;<\/span><br \/>\n    <span class=\"token keyword\">await<\/span> send<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token string\">&#039;type&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;http.response.start&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#039;status&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">200<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#039;headers&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n            <span class=\"token punctuation\">[<\/span><span class=\"token string\">b&#039;content-type&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">b&#039;text\/plain&#039;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">await<\/span> send<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token string\">&#039;type&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;http.response.body&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#039;body&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">b&#039;Hello, Uvicorn!&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">if<\/span> __name__ <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#034;__main__&#034;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    uvicorn<span class=\"token punctuation\">.<\/span>run<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;main:app&#034;<\/span><span class=\"token punctuation\">,<\/span> host<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;127.0.0.1&#034;<\/span><span class=\"token punctuation\">,<\/span> port<span class=\"token operator\">&#061;<\/span><span class=\"token number\">5000<\/span><span class=\"token punctuation\">,<\/span> log_level<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;info&#034;<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>2&#xff09;\u4f7f\u7528 Config \u548c Server \u5b9e\u4f8b<\/p>\n<p>\u5f53\u9700\u8981\u66f4\u7ec6\u7c92\u5ea6\u7684\u63a7\u5236\u65f6&#xff0c;\u53ef\u4ee5\u4f7f\u7528 Config \u548c Server \u5b9e\u4f8b&#xff1a;<\/p>\n<p><span class=\"token keyword\">import<\/span> uvicorn<\/p>\n<p><span class=\"token keyword\">async<\/span> <span class=\"token keyword\">def<\/span> <span class=\"token function\">app<\/span><span class=\"token punctuation\">(<\/span>scope<span class=\"token punctuation\">,<\/span> receive<span class=\"token punctuation\">,<\/span> send<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">assert<\/span> scope<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#039;type&#039;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#039;http&#039;<\/span><br \/>\n    <span class=\"token keyword\">await<\/span> send<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token string\">&#039;type&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;http.response.start&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#039;status&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">200<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#039;headers&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n            <span class=\"token punctuation\">[<\/span><span class=\"token string\">b&#039;content-type&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">b&#039;text\/plain&#039;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">await<\/span> send<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token string\">&#039;type&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;http.response.body&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#039;body&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">b&#039;Hello, Uvicorn!&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">if<\/span> __name__ <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#034;__main__&#034;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    config <span class=\"token operator\">&#061;<\/span> uvicorn<span class=\"token punctuation\">.<\/span>Config<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;main:app&#034;<\/span><span class=\"token punctuation\">,<\/span> host<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;127.0.0.1&#034;<\/span><span class=\"token punctuation\">,<\/span> port<span class=\"token operator\">&#061;<\/span><span class=\"token number\">5000<\/span><span class=\"token punctuation\">,<\/span> log_level<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;info&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    server <span class=\"token operator\">&#061;<\/span> uvicorn<span class=\"token punctuation\">.<\/span>Server<span class=\"token punctuation\">(<\/span>config<span class=\"token punctuation\">)<\/span><br \/>\n    server<span class=\"token punctuation\">.<\/span>run<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>3&#xff09;\u5f02\u6b65\u73af\u5883\u4e2d\u542f\u52a8 Uvicorn<\/p>\n<p>\u5982\u679c\u8981\u5728\u5df2\u6709\u7684\u5f02\u6b65\u4e8b\u4ef6\u5faa\u73af\u4e2d\u542f\u52a8&#xff0c;\u53ef\u4ee5\u4f7f\u7528 uvicorn.Server.serve()&#xff1a;<\/p>\n<p><span class=\"token keyword\">import<\/span> asyncio<br \/>\n<span class=\"token keyword\">import<\/span> uvicorn<\/p>\n<p><span class=\"token keyword\">async<\/span> <span class=\"token keyword\">def<\/span> <span class=\"token function\">app<\/span><span class=\"token punctuation\">(<\/span>scope<span class=\"token punctuation\">,<\/span> receive<span class=\"token punctuation\">,<\/span> send<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">assert<\/span> scope<span class=\"token punctuation\">[<\/span><span class=\"token string\">&#039;type&#039;<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#039;http&#039;<\/span><br \/>\n    <span class=\"token keyword\">await<\/span> send<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token string\">&#039;type&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;http.response.start&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#039;status&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">200<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#039;headers&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span><br \/>\n            <span class=\"token punctuation\">[<\/span><span class=\"token string\">b&#039;content-type&#039;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">b&#039;text\/plain&#039;<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">await<\/span> send<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token string\">&#039;type&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;http.response.body&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n        <span class=\"token string\">&#039;body&#039;<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">b&#039;Hello, Uvicorn!&#039;<\/span><span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">async<\/span> <span class=\"token keyword\">def<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    config <span class=\"token operator\">&#061;<\/span> uvicorn<span class=\"token punctuation\">.<\/span>Config<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;main:app&#034;<\/span><span class=\"token punctuation\">,<\/span> host<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;127.0.0.1&#034;<\/span><span class=\"token punctuation\">,<\/span> port<span class=\"token operator\">&#061;<\/span><span class=\"token number\">5000<\/span><span class=\"token punctuation\">,<\/span> log_level<span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;info&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    server <span class=\"token operator\">&#061;<\/span> uvicorn<span class=\"token punctuation\">.<\/span>Server<span class=\"token punctuation\">(<\/span>config<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">await<\/span> server<span class=\"token punctuation\">.<\/span>serve<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">if<\/span> __name__ <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#034;__main__&#034;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    asyncio<span class=\"token punctuation\">.<\/span>run<span class=\"token punctuation\">(<\/span>main<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101827-680226f32ee5a.png\" alt=\"\u6807\u98985\" height=\"45\" \/><\/p>\n<h3>\u2699\ufe0f \u8fd0\u884c Uvicorn \u7684\u9ad8\u7ea7\u914d\u7f6e<\/h3>\n<p>Uvicorn \u63d0\u4f9b\u4e86\u591a\u79cd\u9ad8\u7ea7\u914d\u7f6e\u9009\u9879\u6765\u6ee1\u8db3\u4e0d\u540c\u5e94\u7528\u7684\u9700\u6c42&#xff0c;\u5305\u62ec HTTP \u6d41\u91cf\u63a7\u5236\u3001SSL \u8bbe\u7f6e\u3001\u8d44\u6e90\u9650\u5236\u7b49\u3002\u5e38\u7528\u914d\u7f6e\u5982\u4e0b&#xff1a;<\/p>\n<table>\n<tr>\u914d\u7f6e\u9009\u9879\u63cf\u8ff0\u9ed8\u8ba4\u503c<\/tr>\n<tbody>\n<tr>\n<td>&#8211;limit-concurrency<\/td>\n<td>\u9650\u5236\u6700\u5927\u5e76\u53d1\u8fde\u63a5\u6570&#xff0c;\u8d85\u51fa\u65f6\u8fd4\u56de HTTP 503<\/td>\n<td>None<\/td>\n<\/tr>\n<tr>\n<td>&#8211;timeout-keep-alive<\/td>\n<td>Keep-Alive \u8d85\u65f6\u65f6\u95f4&#xff0c;\u8d85\u8fc7\u8be5\u65f6\u95f4\u672a\u6536\u5230\u8bf7\u6c42\u5219\u65ad\u5f00\u8fde\u63a5<\/td>\n<td>5<\/td>\n<\/tr>\n<tr>\n<td>&#8211;timeout-graceful-shutdown<\/td>\n<td>\u4f18\u96c5\u5173\u95ed\u670d\u52a1\u5668\u7684\u6700\u5927\u7b49\u5f85\u65f6\u95f4<\/td>\n<td>None<\/td>\n<\/tr>\n<tr>\n<td>&#8211;ssl-version<\/td>\n<td>SSL \u534f\u8bae\u7248\u672c&#xff08;\u53c2\u8003\u6807\u51c6\u5e93 ssl \u6a21\u5757&#xff09;<\/td>\n<td>17<\/td>\n<\/tr>\n<tr>\n<td>&#8211;log-config<\/td>\n<td>\u65e5\u5fd7\u914d\u7f6e\u6587\u4ef6\u8def\u5f84<\/td>\n<td>None<\/td>\n<\/tr>\n<tr>\n<td>&#8211;ws-ping-interval<\/td>\n<td>WebSocket \u5fc3\u8df3\u5305\u53d1\u9001\u95f4\u9694\u65f6\u95f4<\/td>\n<td>20.0<\/td>\n<\/tr>\n<tr>\n<td>&#8211;ws-ping-timeout<\/td>\n<td>WebSocket \u5fc3\u8df3\u5305\u8d85\u65f6\u65f6\u95f4<\/td>\n<td>20.0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u4e9b\u53c2\u6570\u53ef\u4ee5\u5728\u5f00\u53d1\u548c\u751f\u4ea7\u73af\u5883\u4e2d\u8fdb\u884c\u4e0d\u540c\u7684\u8c03\u6574&#xff0c;\u4ee5\u63d0\u5347\u670d\u52a1\u5668\u7684\u54cd\u5e94\u901f\u5ea6\u548c\u5b89\u5168\u6027\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101827-680226f33a3c8.png\" alt=\"\u6807\u98986\" height=\"45\" \/><\/p>\n<h3>&#x1f527; \u4f7f\u7528 Gunicorn \u90e8\u7f72 Uvicorn<\/h3>\n<p>\u5728\u751f\u4ea7\u73af\u5883\u4e2d&#xff0c;\u901a\u5e38\u63a8\u8350\u4f7f\u7528 Gunicorn \u642d\u914d Uvicorn \u7684\u5de5\u4f5c\u8fdb\u7a0b\u6a21\u5f0f\u6765\u90e8\u7f72\u3002\u8fd9\u6837\u53ef\u4ee5\u5145\u5206\u5229\u7528\u591a\u8fdb\u7a0b\u7684\u4f18\u52bf&#xff0c;\u5e76\u4e14\u4eab\u6709 Gunicorn \u7a33\u5b9a\u7684\u8fdb\u7a0b\u7ba1\u7406\u529f\u80fd\u3002<\/p>\n<p>gunicorn -w <span class=\"token number\">4<\/span> -k uvicorn.workers.UvicornWorker example:app<\/p>\n<p>\u6b64\u547d\u4ee4\u4f1a\u542f\u52a8 4 \u4e2a\u5de5\u4f5c\u8fdb\u7a0b&#xff0c;\u5e76\u4f7f\u7528 UvicornWorker \u7ba1\u7406 ASGI \u5e94\u7528\u7684\u591a\u8fdb\u7a0b\u73af\u5883\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101827-680226f3452ab.png\" alt=\"\u6807\u98987\" height=\"45\" \/><\/p>\n<h3>&#x1f4e5; \u4e0b\u8f7d\u5730\u5740<\/h3>\n<p><b><font color=\"Black\" size=\"4\">Uvicorn \u6700\u65b0\u7248 <\/font> <font color=\"Red\" size=\"4\">\u4e0b\u8f7d\u5730\u5740<\/font><\/b><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101827-680226f3500b0.png\" alt=\"\u6807\u98988\" height=\"45\" \/><\/p>\n<h3>&#x1f4ac; \u7ed3\u8bed<\/h3>\n<p>Uvicorn \u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u3001\u914d\u7f6e\u7075\u6d3b\u4e14\u6613\u4e8e\u4f7f\u7528\u7684\u5f02\u6b65 Web \u670d\u52a1\u5668&#xff0c;\u975e\u5e38\u9002\u5408\u73b0\u4ee3 Python \u5f02\u6b65\u6846\u67b6\u7684\u5f00\u53d1\u548c\u90e8\u7f72\u3002\u901a\u8fc7\u5408\u7406\u914d\u7f6e\u548c\u7ed3\u5408 Gunicorn&#xff0c;\u53ef\u4ee5\u5145\u5206\u5229\u7528\u5176\u9ad8\u6027\u80fd\u548c\u7a33\u5b9a\u6027\u6765\u5904\u7406\u5404\u79cd Web \u8bf7\u6c42\u3002<\/p>\n<h4>&#x1f4d2; \u53c2\u8003\u6587\u732e<\/h4>\n<ul>\n<li>Uvicorn \u5b98\u7f51<\/li>\n<li>Uvicorn GitHub\u4ed3\u5e93<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101827-680226f35b261.gif\" alt=\"TheEnd\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101827-680226f367ad7.gif\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/> <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101827-680226f376a3e.gif\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb4.5k\u6b21\uff0c\u70b9\u8d5e38\u6b21\uff0c\u6536\u85cf21\u6b21\u3002Uvicorn \u662f\u4e00\u4e2a\u4e3a Python \u8bbe\u8ba1\u7684 ASGI\uff08\u5f02\u6b65\u670d\u52a1\u5668\u7f51\u5173\u63a5\u53e3\uff09Web \u670d\u52a1\u5668\u3002\u5b83\u586b\u8865\u4e86 Python \u5728\u5f02\u6b65\u6846\u67b6\u4e2d\u7f3a\u4e4f\u4e00\u4e2a\u6700\u5c0f\u5316\u4f4e\u5c42\u6b21\u670d\u52a1\u5668\/\u5e94\u7528\u63a5\u53e3\u7684\u7a7a\u767d\u3002Uvicorn \u652f\u6301 HTTP\/1.1 \u548c WebSockets\uff0c\u662f\u6784\u5efa\u73b0\u4ee3\u5f02\u6b65Web\u5e94\u7528\u7684\u5f3a\u5927\u5de5\u5177\u3002_uvicorn<\/p>\n","protected":false},"author":2,"featured_media":10905,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[495,81,494,190,43,78,44],"topic":[],"class_list":["post-10920","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-pygame","tag-python","tag-python3-11","tag-190","tag-43","tag-78","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010Python\u3011Uvicorn\uff1aPython \u5f02\u6b65 ASGI \u670d\u52a1\u5668\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/10920.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Python\u3011Uvicorn\uff1aPython \u5f02\u6b65 ASGI \u670d\u52a1\u5668\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb4.5k\u6b21\uff0c\u70b9\u8d5e38\u6b21\uff0c\u6536\u85cf21\u6b21\u3002Uvicorn \u662f\u4e00\u4e2a\u4e3a Python \u8bbe\u8ba1\u7684 ASGI\uff08\u5f02\u6b65\u670d\u52a1\u5668\u7f51\u5173\u63a5\u53e3\uff09Web \u670d\u52a1\u5668\u3002\u5b83\u586b\u8865\u4e86 Python \u5728\u5f02\u6b65\u6846\u67b6\u4e2d\u7f3a\u4e4f\u4e00\u4e2a\u6700\u5c0f\u5316\u4f4e\u5c42\u6b21\u670d\u52a1\u5668\/\u5e94\u7528\u63a5\u53e3\u7684\u7a7a\u767d\u3002Uvicorn \u652f\u6301 HTTP\/1.1 \u548c WebSockets\uff0c\u662f\u6784\u5efa\u73b0\u4ee3\u5f02\u6b65Web\u5e94\u7528\u7684\u5f3a\u5927\u5de5\u5177\u3002_uvicorn\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/10920.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T10:18:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101826-680226f2384b0.gif\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/10920.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/10920.html\",\"name\":\"\u3010Python\u3011Uvicorn\uff1aPython \u5f02\u6b65 ASGI \u670d\u52a1\u5668\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T10:18:28+00:00\",\"dateModified\":\"2025-04-18T10:18:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/10920.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/10920.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/10920.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Python\u3011Uvicorn\uff1aPython \u5f02\u6b65 ASGI \u670d\u52a1\u5668\u8be6\u89e3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Python\u3011Uvicorn\uff1aPython \u5f02\u6b65 ASGI \u670d\u52a1\u5668\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/10920.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010Python\u3011Uvicorn\uff1aPython \u5f02\u6b65 ASGI \u670d\u52a1\u5668\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb4.5k\u6b21\uff0c\u70b9\u8d5e38\u6b21\uff0c\u6536\u85cf21\u6b21\u3002Uvicorn \u662f\u4e00\u4e2a\u4e3a Python \u8bbe\u8ba1\u7684 ASGI\uff08\u5f02\u6b65\u670d\u52a1\u5668\u7f51\u5173\u63a5\u53e3\uff09Web \u670d\u52a1\u5668\u3002\u5b83\u586b\u8865\u4e86 Python \u5728\u5f02\u6b65\u6846\u67b6\u4e2d\u7f3a\u4e4f\u4e00\u4e2a\u6700\u5c0f\u5316\u4f4e\u5c42\u6b21\u670d\u52a1\u5668\/\u5e94\u7528\u63a5\u53e3\u7684\u7a7a\u767d\u3002Uvicorn \u652f\u6301 HTTP\/1.1 \u548c WebSockets\uff0c\u662f\u6784\u5efa\u73b0\u4ee3\u5f02\u6b65Web\u5e94\u7528\u7684\u5f3a\u5927\u5de5\u5177\u3002_uvicorn","og_url":"https:\/\/www.wsisp.com\/helps\/10920.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T10:18:28+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418101826-680226f2384b0.gif"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/10920.html","url":"https:\/\/www.wsisp.com\/helps\/10920.html","name":"\u3010Python\u3011Uvicorn\uff1aPython \u5f02\u6b65 ASGI \u670d\u52a1\u5668\u8be6\u89e3 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T10:18:28+00:00","dateModified":"2025-04-18T10:18:28+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/10920.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/10920.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/10920.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010Python\u3011Uvicorn\uff1aPython \u5f02\u6b65 ASGI \u670d\u52a1\u5668\u8be6\u89e3"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/10920","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=10920"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/10920\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/10905"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=10920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=10920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=10920"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=10920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}