{"id":2848,"date":"2025-03-16T12:27:38","date_gmt":"2025-03-16T04:27:38","guid":{"rendered":"https:\/\/www.laixuexila.com\/?p=2848"},"modified":"2025-03-16T12:27:38","modified_gmt":"2025-03-16T04:27:38","slug":"python3-%e7%bd%91%e7%bb%9c%e7%bc%96%e7%a8%8b13%ef%bc%9a%e6%9e%84%e5%bb%ba%e9%ab%98%e6%95%88%e7%9a%84%e5%bc%82%e6%ad%a5-web-%e6%9c%8d%e5%8a%a1%e5%92%8c-api","status":"publish","type":"post","link":"https:\/\/www.laixuexila.com\/index.php\/2025\/03\/16\/python3-%e7%bd%91%e7%bb%9c%e7%bc%96%e7%a8%8b13%ef%bc%9a%e6%9e%84%e5%bb%ba%e9%ab%98%e6%95%88%e7%9a%84%e5%bc%82%e6%ad%a5-web-%e6%9c%8d%e5%8a%a1%e5%92%8c-api\/","title":{"rendered":"Python3 \u7f51\u7edc\u7f16\u7a0b13\uff1a\u6784\u5efa\u9ad8\u6548\u7684\u5f02\u6b65 Web \u670d\u52a1\u548c API"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5f02\u6b65 Web \u670d\u52a1\u548c API \u5141\u8bb8\u6211\u4eec\u5728\u5904\u7406\u5927\u91cf\u5e76\u53d1\u8bf7\u6c42\u65f6\uff0c\u907f\u514d\u963b\u585e\u7ebf\u7a0b\uff0c\u63d0\u9ad8\u7cfb\u7edf\u7684\u541e\u5410\u91cf\u548c\u54cd\u5e94\u901f\u5ea6\u3002\u901a\u8fc7\u4f7f\u7528\u5f02\u6b65 I\/O \u548c\u4efb\u52a1\u8c03\u5ea6\uff0c\u5f02\u6b65\u670d\u52a1\u80fd\u591f\u6709\u6548\u5730\u5904\u7406\u5927\u91cf\u7684 I\/O \u5bc6\u96c6\u578b\u64cd\u4f5c\uff08\u5982\u6570\u636e\u5e93\u67e5\u8be2\u3001\u5916\u90e8 API \u8bf7\u6c42\u7b49\uff09\uff0c\u5e76\u4e14\u51cf\u5c11\u5ef6\u8fdf\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 Python \u4e2d\uff0c\u5e38\u7528\u7684\u5f02\u6b65 Web \u6846\u67b6\u662f <strong>FastAPI<\/strong> \u548c <strong>Sanic<\/strong>\uff0c\u5b83\u4eec\u80fd\u591f\u5feb\u901f\u6784\u5efa\u9ad8\u6027\u80fd\u7684\u5f02\u6b65 Web \u670d\u52a1\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>13.1 \u4f7f\u7528 FastAPI \u6784\u5efa\u5f02\u6b65 Web \u670d\u52a1<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">FastAPI \u662f\u4e00\u4e2a\u57fa\u4e8e Python 3.6+ \u7684\u73b0\u4ee3\u3001\u5feb\u901f\uff08\u9ad8\u6027\u80fd\uff09\u7684 Web \u6846\u67b6\uff0c\u5b83\u4e13\u95e8\u4e3a\u6784\u5efa\u5f02\u6b65 REST API \u8bbe\u8ba1\uff0c\u5e76\u4e14\u652f\u6301\u5f02\u6b65\u64cd\u4f5c\uff0c\u5982\u6570\u636e\u5e93\u67e5\u8be2\u3001\u6587\u4ef6\u4e0a\u4f20\u7b49\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>13.1.1 \u5b89\u88c5 FastAPI \u548c Uvicorn<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148\uff0c\u5b89\u88c5 FastAPI \u548c Uvicorn\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install fastapi uvicorn<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Uvicorn \u662f\u4e00\u4e2a ASGI \u670d\u52a1\u5668\uff0c\u9002\u5408\u8fd0\u884c FastAPI \u5e94\u7528\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>13.1.2 \u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u5f02\u6b65 API<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684 FastAPI \u5e94\u7528\uff0c\u5e76\u5728\u5176\u4e2d\u5b9e\u73b0\u4e00\u4e2a\u5f02\u6b65\u7684 API\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from fastapi import FastAPI\nimport asyncio\n\napp = FastAPI()\n\n# \u5f02\u6b65\u7684 API \u8def\u7531\n@app.get(\"\/async-task\")\nasync def async_task():\n    await asyncio.sleep(2)  # \u6a21\u62df\u5f02\u6b65\u4efb\u52a1\n    return {\"message\": \"\u4efb\u52a1\u5b8c\u6210\"}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u5b9a\u4e49\u4e86\u4e00\u4e2a\u5f02\u6b65 API <code>\/async-task<\/code>\uff0c\u5f53\u8bbf\u95ee\u6b64\u8def\u7531\u65f6\uff0cAPI \u5c06\u7b49\u5f85 2 \u79d2\u949f\u5e76\u8fd4\u56de\u4e00\u4e2a\u6d88\u606f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>13.1.3 \u542f\u52a8 FastAPI \u5e94\u7528<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528 <code>uvicorn<\/code> \u542f\u52a8\u5e94\u7528\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>uvicorn main:app --reload<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>main<\/code> \u662f\u6211\u4eec\u5e94\u7528\u7684\u6587\u4ef6\u540d\uff0c<code>app<\/code> \u662f FastAPI \u5b9e\u4f8b\u3002<code>--reload<\/code> \u4f7f\u5f97\u6bcf\u6b21\u4fee\u6539\u4ee3\u7801\u540e\u5e94\u7528\u81ea\u52a8\u91cd\u8f7d\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8bbf\u95ee <code>http:\/\/127.0.0.1:8000\/async-task<\/code>\uff0c\u4f60\u5c06\u770b\u5230\u54cd\u5e94\u7ed3\u679c\uff0c\u5c3d\u7ba1\u5904\u7406\u65f6\u95f4\u8f83\u957f\uff0c\u4f46\u5e94\u7528\u4e0d\u4f1a\u963b\u585e\u5176\u4ed6\u8bf7\u6c42\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>13.2 \u5f02\u6b65\u6570\u636e\u5e93\u64cd\u4f5c<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f02\u6b65 Web \u670d\u52a1\u4e2d\u7684\u6570\u636e\u5e93\u64cd\u4f5c\uff08\u5c24\u5176\u662f\u4f7f\u7528 SQL \u6570\u636e\u5e93\uff09\u901a\u5e38\u662f\u4e00\u4e2a\u74f6\u9888\u3002\u4e3a\u4e86\u63d0\u9ad8\u6027\u80fd\uff0c\u901a\u5e38\u9700\u8981\u4f7f\u7528\u5f02\u6b65\u6570\u636e\u5e93\u5e93\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>13.2.1 \u4f7f\u7528 <code>databases<\/code> \u5e93<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>databases<\/code> \u5e93\u662f\u4e00\u4e2a\u652f\u6301\u5f02\u6b65 SQL \u67e5\u8be2\u7684\u5e93\uff0c\u53ef\u4ee5\u4e0e FastAPI \u96c6\u6210\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5 <code>databases<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install databases<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>13.2.2 \u914d\u7f6e\u5f02\u6b65\u6570\u636e\u5e93\u8fde\u63a5<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>from databases import Database\nfrom fastapi import FastAPI\n\nDATABASE_URL = \"postgresql+asyncpg:\/\/user:password@localhost\/mydatabase\"\ndatabase = Database(DATABASE_URL)\n\napp = FastAPI()\n\n@app.on_event(\"startup\")\nasync def startup():\n    await database.connect()\n\n@app.on_event(\"shutdown\")\nasync def shutdown():\n    await database.disconnect()\n\n@app.get(\"\/users\/{user_id}\")\nasync def read_user(user_id: int):\n    query = \"SELECT * FROM users WHERE id = :id\"\n    result = await database.fetch_one(query, values={\"id\": user_id})\n    return result<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u901a\u8fc7 <code>databases<\/code> \u5e93\u4f7f\u7528\u5f02\u6b65\u7684 PostgreSQL \u6570\u636e\u5e93\u8fde\u63a5\u6765\u67e5\u8be2\u7528\u6237\u4fe1\u606f\u3002\u901a\u8fc7 <code>await<\/code> \u5173\u952e\u5b57\uff0c\u6211\u4eec\u80fd\u591f\u5f02\u6b65\u5730\u6267\u884c\u6570\u636e\u5e93\u67e5\u8be2\uff0c\u907f\u514d\u963b\u585e\u5e94\u7528\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>13.2.3 \u4f7f\u7528\u5f02\u6b65 ORM\uff08\u5982 Tortoise ORM\uff09<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u4f60\u9700\u8981\u4e00\u4e2a\u5f02\u6b65\u7684 ORM\uff08\u5bf9\u8c61\u5173\u7cfb\u6620\u5c04\uff09\u5de5\u5177\uff0c<code>Tortoise ORM<\/code> \u662f\u4e00\u4e2a\u5f88\u597d\u7684\u9009\u62e9\uff0c\u652f\u6301\u4e0e FastAPI \u914d\u5408\u4f7f\u7528\uff0c\u7b80\u5316\u6570\u636e\u5e93\u64cd\u4f5c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install tortoise-orm<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>13.2.4 \u4f7f\u7528 Tortoise ORM \u521b\u5efa\u6a21\u578b<\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>from tortoise import fields, Tortoise\nfrom fastapi import FastAPI\n\napp = FastAPI()\n\nclass User(models.Model):\n    id = fields.IntField(pk=True)\n    name = fields.CharField(max_length=50)\n    email = fields.CharField(max_length=100)\n\n@app.on_event(\"startup\")\nasync def startup():\n    await Tortoise.init(\n        db_url='postgresql:\/\/user:password@localhost\/mydatabase',\n        modules={'models': &#91;'__main__']}\n    )\n    await Tortoise.generate_schemas()\n\n@app.on_event(\"shutdown\")\nasync def shutdown():\n    await Tortoise.close_connections()\n\n@app.get(\"\/users\/{user_id}\")\nasync def get_user(user_id: int):\n    user = await User.get(id=user_id)\n    return {\"name\": user.name, \"email\": user.email}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528\u4e86 Tortoise ORM \u6765\u5b9a\u4e49\u4e00\u4e2a\u5f02\u6b65\u7684 <code>User<\/code> \u6a21\u578b\uff0c\u5e76\u5728 FastAPI \u8def\u7531\u4e2d\u8fdb\u884c\u5f02\u6b65\u67e5\u8be2\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>13.3 \u5f02\u6b65\u6587\u4ef6\u4e0a\u4f20\u4e0e\u4e0b\u8f7d<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">FastAPI \u8fd8\u652f\u6301\u5f02\u6b65\u6587\u4ef6\u4e0a\u4f20\u548c\u4e0b\u8f7d\uff0c\u9002\u7528\u4e8e\u5904\u7406\u5927\u6587\u4ef6\u6216\u9700\u8981\u8f83\u957f\u65f6\u95f4\u7684 I\/O \u64cd\u4f5c\u7684\u573a\u666f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>13.3.1 \u5f02\u6b65\u6587\u4ef6\u4e0a\u4f20<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">FastAPI \u5141\u8bb8\u4f7f\u7528 <code>File<\/code> \u548c <code>UploadFile<\/code> \u6765\u5904\u7406\u6587\u4ef6\u4e0a\u4f20\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from fastapi import FastAPI, File, UploadFile\n\napp = FastAPI()\n\n@app.post(\"\/uploadfile\/\")\nasync def upload_file(file: UploadFile = File(...)):\n    with open(file.filename, \"wb\") as buffer:\n        buffer.write(file.file.read())\n    return {\"filename\": file.filename}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>UploadFile<\/code> \u662f\u4e00\u4e2a\u5f02\u6b65\u5bf9\u8c61\uff0c\u5b83\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u6587\u4ef6\u8bfb\u53d6\u65b9\u5f0f\u3002\u6211\u4eec\u901a\u8fc7 <code>await<\/code> \u8fdb\u884c\u6587\u4ef6\u8bfb\u53d6\uff0c\u907f\u514d\u963b\u585e\u670d\u52a1\u5668\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>13.3.2 \u5f02\u6b65\u6587\u4ef6\u4e0b\u8f7d<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u901a\u8fc7 FastAPI \u63d0\u4f9b\u7684 <code>FileResponse<\/code> \u6765\u5f02\u6b65\u5904\u7406\u6587\u4ef6\u4e0b\u8f7d\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from fastapi import FastAPI\nfrom fastapi.responses import FileResponse\n\napp = FastAPI()\n\n@app.get(\"\/download\/{file_name}\")\nasync def download_file(file_name: str):\n    file_path = f\".\/files\/{file_name}\"\n    return FileResponse(file_path)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u65f6\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7 <code>GET \/download\/{file_name}<\/code> \u8def\u7531\u6765\u4e0b\u8f7d\u6587\u4ef6\uff0cFastAPI \u4f1a\u5f02\u6b65\u8bfb\u53d6\u5e76\u8fd4\u56de\u6587\u4ef6\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>13.4 \u6027\u80fd\u4f18\u5316\u4e0e\u9ad8\u5e76\u53d1\u5904\u7406<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3a\u4e86\u5904\u7406\u9ad8\u5e76\u53d1\u8bf7\u6c42\uff0c\u5f02\u6b65 Web \u670d\u52a1\u9700\u8981\u505a\u4e00\u4e9b\u6027\u80fd\u4f18\u5316\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>13.4.1 \u8fde\u63a5\u6c60\u7ba1\u7406<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7\u4f7f\u7528\u6570\u636e\u5e93\u8fde\u63a5\u6c60\uff0c\u53ef\u4ee5\u51cf\u5c11\u6bcf\u6b21\u8bf7\u6c42\u90fd\u8981\u91cd\u65b0\u8fde\u63a5\u6570\u636e\u5e93\u7684\u5f00\u9500\uff0c\u63d0\u9ad8\u6027\u80fd\u3002<code>databases<\/code> \u5e93\u548c\u5176\u4ed6 ORM \u652f\u6301\u8fde\u63a5\u6c60\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>13.4.2 \u8bf7\u6c42\u9650\u6d41<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528 <code>asyncio<\/code> \u6216 FastAPI \u63d0\u4f9b\u7684\u4e2d\u95f4\u4ef6\uff0c\u53ef\u4ee5\u5b9e\u73b0\u8bf7\u6c42\u9650\u6d41\uff0c\u9632\u6b62\u6076\u610f\u653b\u51fb\u6216\u8fc7\u9ad8\u7684\u8bf7\u6c42\u8d1f\u8f7d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>13.4.3 \u80cc\u538b\u63a7\u5236<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u7cfb\u7edf\u8d1f\u8f7d\u8fc7\u9ad8\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u5f02\u6b65\u961f\u5217\u548c\u5f02\u6b65\u5904\u7406\u4efb\u52a1\u6765\u8fdb\u884c\u80cc\u538b\u63a7\u5236\uff0c\u907f\u514d\u7cfb\u7edf\u8fc7\u8f7d\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u603b\u7ed3\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>FastAPI<\/strong> \u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5f02\u6b65\u652f\u6301\uff0c\u80fd\u591f\u5feb\u901f\u6784\u5efa\u9ad8\u6027\u80fd\u7684 API\u3002<\/li>\n\n\n\n<li>\u4f7f\u7528\u5f02\u6b65\u6570\u636e\u5e93\u8fde\u63a5\u548c ORM\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u63d0\u9ad8\u6570\u636e\u5e93\u67e5\u8be2\u6027\u80fd\u3002<\/li>\n\n\n\n<li>\u652f\u6301\u5f02\u6b65\u6587\u4ef6\u4e0a\u4f20\u4e0e\u4e0b\u8f7d\uff0c\u9002\u7528\u4e8e\u5904\u7406\u5927\u6587\u4ef6\u7684\u573a\u666f\u3002<\/li>\n\n\n\n<li>\u5bf9\u4e8e\u9ad8\u5e76\u53d1\u5e94\u7528\uff0c\u91c7\u7528\u8fde\u63a5\u6c60\u3001\u8bf7\u6c42\u9650\u6d41\u548c\u80cc\u538b\u63a7\u5236\u7b49\u65b9\u6cd5\u6765\u4f18\u5316\u6027\u80fd\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u4e0b\u7bc7\u6587\u7ae0\u6211\u4eec\u5c06\u63a2\u8ba8\u5982\u4f55\u4f7f\u7528\u5f02\u6b65 Web \u670d\u52a1\u5b9e\u73b0\u5b9e\u65f6\u5e94\u7528\uff08\u5982 WebSocket \u548c\u804a\u5929\u5e94\u7528\uff09\uff01<\/strong> <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f02\u6b65 Web \u670d\u52a1\u548c API \u5141\u8bb8\u6211\u4eec\u5728\u5904\u7406\u5927\u91cf\u5e76\u53d1\u8bf7\u6c42\u65f6\uff0c\u907f\u514d\u963b\u585e\u7ebf\u7a0b\uff0c\u63d0\u9ad8\u7cfb\u7edf\u7684\u541e\u5410\u91cf\u548c\u54cd\u5e94\u901f\u5ea6\u3002\u901a\u8fc7\u4f7f\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2849,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[79],"tags":[],"class_list":["post-2848","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-3-"],"_links":{"self":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/comments?post=2848"}],"version-history":[{"count":1,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2848\/revisions"}],"predecessor-version":[{"id":2850,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/2848\/revisions\/2850"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media\/2849"}],"wp:attachment":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media?parent=2848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/categories?post=2848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/tags?post=2848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}