{"id":1172408,"date":"2025-01-15T16:49:00","date_gmt":"2025-01-15T08:49:00","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1172408.html"},"modified":"2025-01-15T16:49:18","modified_gmt":"2025-01-15T08:49:18","slug":"python%e5%a6%82%e4%bd%95%e6%8c%87%e5%ae%9a%e4%b8%8b%e8%bd%bd%e4%bd%8d%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1172408.html","title":{"rendered":"python\u5982\u4f55\u6307\u5b9a\u4e0b\u8f7d\u4f4d\u7f6e"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/26074518\/6767101d-7bdf-4090-a135-f3d7c2772c31.webp\" alt=\"python\u5982\u4f55\u6307\u5b9a\u4e0b\u8f7d\u4f4d\u7f6e\" \/><\/p>\n<p><p> \u5728Python\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684\u65b9\u6cd5\u6765\u6307\u5b9a\u6587\u4ef6\u7684\u4e0b\u8f7d\u4f4d\u7f6e\u3002<strong>\u4e00\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u4f7f\u7528<code>requests<\/code>\u5e93\u8fdb\u884cHTTP\u8bf7\u6c42\u3001\u7ed3\u5408\u6587\u4ef6\u64cd\u4f5c\u6765\u4fdd\u5b58\u6587\u4ef6\uff0c\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u4f7f\u7528<code>urllib<\/code>\u5e93\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u4e0b\u9762\u6211\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5982\u4f55\u4f7f\u7528<code>requests<\/code>\u5e93\u6307\u5b9a\u4e0b\u8f7d\u4f4d\u7f6e\u3002<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528requests\u5e93\u4e0b\u8f7d\u6587\u4ef6\u5e76\u6307\u5b9a\u4fdd\u5b58\u4f4d\u7f6e\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<p>def download_file(url, save_path):<\/p>\n<p>    response = requests.get(url, stream=True)<\/p>\n<p>    with open(save_path, &#39;wb&#39;) as file:<\/p>\n<p>        for chunk in response.iter_content(chunk_size=8192):<\/p>\n<p>            file.write(chunk)<\/p>\n<p>    print(f&quot;File downloaded and saved to {save_path}&quot;)<\/p>\n<h2><strong>\u793a\u4f8b\u7528\u6cd5<\/strong><\/h2>\n<p>url = &quot;https:\/\/example.com\/file.zip&quot;<\/p>\n<p>save_path = &quot;\/path\/to\/your\/directory\/file.zip&quot;<\/p>\n<p>download_file(url, save_path)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>requests.get()<\/code>\u6765\u53d1\u9001HTTP GET\u8bf7\u6c42\uff0c\u5e76\u5c06\u54cd\u5e94\u5185\u5bb9\u4ee5\u6d41\u7684\u65b9\u5f0f\u8fed\u4ee3\u5199\u5165\u5230\u6307\u5b9a\u8def\u5f84\u7684\u6587\u4ef6\u4e2d\u3002<code>save_path<\/code>\u53c2\u6570\u5c31\u662f\u6307\u5b9a\u4e0b\u8f7d\u4fdd\u5b58\u7684\u6587\u4ef6\u8def\u5f84\u3002<\/p>\n<\/p>\n<p><p>\u63a5\u4e0b\u6765\u6211\u4eec\u5c06\u8be6\u7ec6\u63a2\u8ba8\u5176\u4ed6\u76f8\u5173\u7684\u5185\u5bb9\uff0c\u5305\u62ec\u5982\u4f55\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u6307\u5b9a\u8def\u5f84\u3001\u4f7f\u7528<code>urllib<\/code>\u5e93\u4e0b\u8f7d\u6587\u4ef6\u3001\u5904\u7406\u4e0b\u8f7d\u9519\u8bef\uff0c\u4ee5\u53ca\u5982\u4f55\u521b\u5efa\u76ee\u5f55\u7ed3\u6784\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u6307\u5b9a\u8def\u5f84\u7684\u57fa\u672c\u65b9\u6cd5<\/h2>\n<\/p>\n<p><h3>1.1 \u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\u548c\u76f8\u5bf9\u8def\u5f84<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\u6216\u76f8\u5bf9\u8def\u5f84\u6765\u6307\u5b9a\u6587\u4ef6\u4fdd\u5b58\u4f4d\u7f6e\u3002<\/p>\n<\/p>\n<p><p><strong>\u7edd\u5bf9\u8def\u5f84\uff1a<\/strong><\/p>\n<\/p>\n<p><p>\u7edd\u5bf9\u8def\u5f84\u662f\u6307\u4ece\u6839\u76ee\u5f55\u5f00\u59cb\u7684\u5b8c\u6574\u8def\u5f84\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">save_path = &quot;\/Users\/username\/Downloads\/file.zip&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u76f8\u5bf9\u8def\u5f84\uff1a<\/strong><\/p>\n<\/p>\n<p><p>\u76f8\u5bf9\u8def\u5f84\u662f\u76f8\u5bf9\u4e8e\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u7684\u8def\u5f84\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">save_path = &quot;downloads\/file.zip&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\u65f6\uff0c\u9700\u8981\u786e\u4fdd\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u5b58\u5728\u6307\u5b9a\u7684\u76f8\u5bf9\u8def\u5f84\u3002\u5982\u679c\u8def\u5f84\u4e0d\u5b58\u5728\uff0c\u53ef\u4ee5\u4f7f\u7528<code>os.makedirs()<\/code>\u6765\u521b\u5efa\u76ee\u5f55\u3002<\/p>\n<\/p>\n<p><h3>1.2 \u4f7f\u7528os.path\u548cpathlib\u6a21\u5757<\/h3>\n<\/p>\n<p><p>Python\u7684<code>os.path<\/code>\u6a21\u5757\u548c<code>pathlib<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5904\u7406\u6587\u4ef6\u8def\u5f84\u7684\u4fbf\u6377\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528os.path\u6a21\u5757\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>directory = &quot;downloads&quot;<\/p>\n<p>filename = &quot;file.zip&quot;<\/p>\n<p>save_path = os.path.join(directory, filename)<\/p>\n<h2><strong>\u786e\u4fdd\u76ee\u5f55\u5b58\u5728<\/strong><\/h2>\n<p>if not os.path.exists(directory):<\/p>\n<p>    os.makedirs(directory)<\/p>\n<p>print(f&quot;File will be saved to: {save_path}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u4f7f\u7528pathlib\u6a21\u5757\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pathlib import Path<\/p>\n<p>directory = Path(&quot;downloads&quot;)<\/p>\n<p>filename = &quot;file.zip&quot;<\/p>\n<p>save_path = directory \/ filename<\/p>\n<h2><strong>\u786e\u4fdd\u76ee\u5f55\u5b58\u5728<\/strong><\/h2>\n<p>directory.mkdir(parents=True, exist_ok=True)<\/p>\n<p>print(f&quot;File will be saved to: {save_path}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e8c\u3001\u4f7f\u7528urllib\u5e93\u4e0b\u8f7d\u6587\u4ef6<\/h2>\n<\/p>\n<p><p>\u9664\u4e86<code>requests<\/code>\u5e93\u5916\uff0cPython\u7684<code>urllib<\/code>\u5e93\u4e5f\u53ef\u4ee5\u7528\u4e8e\u4e0b\u8f7d\u6587\u4ef6\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import urllib.request<\/p>\n<p>def download_file(url, save_path):<\/p>\n<p>    urllib.request.urlretrieve(url, save_path)<\/p>\n<p>    print(f&quot;File downloaded and saved to {save_path}&quot;)<\/p>\n<h2><strong>\u793a\u4f8b\u7528\u6cd5<\/strong><\/h2>\n<p>url = &quot;https:\/\/example.com\/file.zip&quot;<\/p>\n<p>save_path = &quot;\/path\/to\/your\/directory\/file.zip&quot;<\/p>\n<p>download_file(url, save_path)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>urllib.request.urlretrieve()<\/code>\u51fd\u6570\u5c06URL\u5185\u5bb9\u4e0b\u8f7d\u5e76\u4fdd\u5b58\u5230\u6307\u5b9a\u8def\u5f84\u3002<\/p>\n<\/p>\n<p><h2>\u4e09\u3001\u5904\u7406\u4e0b\u8f7d\u9519\u8bef<\/h2>\n<\/p>\n<p><p>\u5728\u4e0b\u8f7d\u6587\u4ef6\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u9519\u8bef\uff0c\u4f8b\u5982\u7f51\u7edc\u95ee\u9898\u3001\u6587\u4ef6\u4e0d\u5b58\u5728\u7b49\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>try-except<\/code>\u5757\u6765\u5904\u7406\u8fd9\u4e9b\u9519\u8bef\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<p>def download_file(url, save_path):<\/p>\n<p>    try:<\/p>\n<p>        response = requests.get(url, stream=True)<\/p>\n<p>        response.r<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>se_for_status()  # \u68c0\u67e5\u8bf7\u6c42\u662f\u5426\u6210\u529f<\/p>\n<p>        with open(save_path, &#39;wb&#39;) as file:<\/p>\n<p>            for chunk in response.iter_content(chunk_size=8192):<\/p>\n<p>                file.write(chunk)<\/p>\n<p>        print(f&quot;File downloaded and saved to {save_path}&quot;)<\/p>\n<p>    except requests.exceptions.HTTPError as http_err:<\/p>\n<p>        print(f&quot;HTTP error occurred: {http_err}&quot;)<\/p>\n<p>    except Exception as err:<\/p>\n<p>        print(f&quot;An error occurred: {err}&quot;)<\/p>\n<h2><strong>\u793a\u4f8b\u7528\u6cd5<\/strong><\/h2>\n<p>url = &quot;https:\/\/example.com\/file.zip&quot;<\/p>\n<p>save_path = &quot;\/path\/to\/your\/directory\/file.zip&quot;<\/p>\n<p>download_file(url, save_path)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>response.raise_for_status()<\/code>\u6765\u68c0\u67e5HTTP\u8bf7\u6c42\u662f\u5426\u6210\u529f\uff0c\u5e76\u4f7f\u7528<code>try-except<\/code>\u5757\u6355\u83b7\u5e76\u5904\u7406\u53ef\u80fd\u7684\u9519\u8bef\u3002<\/p>\n<\/p>\n<p><h2>\u56db\u3001\u521b\u5efa\u76ee\u5f55\u7ed3\u6784<\/h2>\n<\/p>\n<p><p>\u5728\u4e0b\u8f7d\u6587\u4ef6\u65f6\uff0c\u6709\u65f6\u9700\u8981\u786e\u4fdd\u76ee\u6807\u76ee\u5f55\u5b58\u5728\u3002\u5982\u679c\u76ee\u5f55\u4e0d\u5b58\u5728\uff0c\u53ef\u4ee5\u4f7f\u7528<code>os.makedirs()<\/code>\u6216<code>Path.mkdir()<\/code>\u521b\u5efa\u76ee\u5f55\u3002<\/p>\n<\/p>\n<p><h3>4.1 \u4f7f\u7528os.makedirs()\u521b\u5efa\u76ee\u5f55<\/h3>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>directory = &quot;\/path\/to\/your\/directory&quot;<\/p>\n<p>if not os.path.exists(directory):<\/p>\n<p>    os.makedirs(directory)<\/p>\n<p>print(f&quot;Directory created: {directory}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>4.2 \u4f7f\u7528Path.mkdir()\u521b\u5efa\u76ee\u5f55<\/h3>\n<\/p>\n<p><pre><code class=\"language-python\">from pathlib import Path<\/p>\n<p>directory = Path(&quot;\/path\/to\/your\/directory&quot;)<\/p>\n<p>directory.mkdir(parents=True, exist_ok=True)<\/p>\n<p>print(f&quot;Directory created: {directory}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e94\u3001\u4e0b\u8f7d\u8fdb\u5ea6\u663e\u793a<\/h2>\n<\/p>\n<p><p>\u5728\u4e0b\u8f7d\u5927\u6587\u4ef6\u65f6\uff0c\u663e\u793a\u4e0b\u8f7d\u8fdb\u5ea6\u53ef\u4ee5\u63d0\u9ad8\u7528\u6237\u4f53\u9a8c\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>tqdm<\/code>\u5e93\u6765\u663e\u793a\u4e0b\u8f7d\u8fdb\u5ea6\u3002<\/p>\n<\/p>\n<p><p>\u9996\u5148\u5b89\u88c5<code>tqdm<\/code>\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install tqdm<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\u4fee\u6539\u4e0b\u8f7d\u4ee3\u7801\u4ee5\u663e\u793a\u8fdb\u5ea6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<p>from tqdm import tqdm<\/p>\n<p>def download_file(url, save_path):<\/p>\n<p>    response = requests.get(url, stream=True)<\/p>\n<p>    total_size = int(response.headers.get(&#39;content-length&#39;, 0))<\/p>\n<p>    with open(save_path, &#39;wb&#39;) as file, tqdm(<\/p>\n<p>        desc=save_path,<\/p>\n<p>        total=total_size,<\/p>\n<p>        unit=&#39;B&#39;,<\/p>\n<p>        unit_scale=True,<\/p>\n<p>        unit_divisor=1024,<\/p>\n<p>    ) as bar:<\/p>\n<p>        for chunk in response.iter_content(chunk_size=8192):<\/p>\n<p>            file.write(chunk)<\/p>\n<p>            bar.update(len(chunk))<\/p>\n<p>    print(f&quot;File downloaded and saved to {save_path}&quot;)<\/p>\n<h2><strong>\u793a\u4f8b\u7528\u6cd5<\/strong><\/h2>\n<p>url = &quot;https:\/\/example.com\/file.zip&quot;<\/p>\n<p>save_path = &quot;\/path\/to\/your\/directory\/file.zip&quot;<\/p>\n<p>download_file(url, save_path)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>tqdm<\/code>\u6765\u663e\u793a\u4e0b\u8f7d\u8fdb\u5ea6\u6761\u3002<\/p>\n<\/p>\n<p><h2>\u516d\u3001\u603b\u7ed3<\/h2>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u5728Python\u4e2d\u6307\u5b9a\u6587\u4ef6\u7684\u4e0b\u8f7d\u4f4d\u7f6e\uff0c\u5e76\u5904\u7406\u4e0b\u8f7d\u8fc7\u7a0b\u4e2d\u7684\u5404\u79cd\u95ee\u9898\u3002<strong>\u6838\u5fc3\u6b65\u9aa4\u5305\u62ec\u4f7f\u7528<code>requests<\/code>\u6216<code>urllib<\/code>\u5e93\u4e0b\u8f7d\u6587\u4ef6\u3001\u6307\u5b9a\u4fdd\u5b58\u8def\u5f84\u3001\u5904\u7406\u4e0b\u8f7d\u9519\u8bef\u3001\u521b\u5efa\u5fc5\u8981\u7684\u76ee\u5f55\u7ed3\u6784\u4ee5\u53ca\u663e\u793a\u4e0b\u8f7d\u8fdb\u5ea6\u3002<\/strong>\u8fd9\u4e9b\u6280\u5de7\u53ef\u4ee5\u5e2e\u52a9\u60a8\u5728\u5f00\u53d1\u4e2d\u66f4\u9ad8\u6548\u5730\u5904\u7406\u6587\u4ef6\u4e0b\u8f7d\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><p>\u7ee7\u7eed\u6df1\u5165\u4e86\u89e3\u76f8\u5173\u5e93\u548c\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u66f4\u7075\u6d3b\u5730\u5e94\u7528\u8fd9\u4e9b\u77e5\u8bc6\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u8bbe\u7f6e\u6587\u4ef6\u4e0b\u8f7d\u8def\u5f84\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u6307\u5b9a\u6587\u4ef6\u8def\u5f84\u6765\u8bbe\u7f6e\u4e0b\u8f7d\u4f4d\u7f6e\u3002\u4f7f\u7528<code>requests<\/code>\u5e93\u4e0b\u8f7d\u6587\u4ef6\u65f6\uff0c\u53ef\u4ee5\u5728\u4fdd\u5b58\u6587\u4ef6\u65f6\u6307\u5b9a\u5b8c\u6574\u7684\u8def\u5f84\u3002\u4f8b\u5982\uff0c<code>with open(&#39;\/path\/to\/directory\/filename&#39;, &#39;wb&#39;) as f:<\/code> \u53ef\u4ee5\u5c06\u6587\u4ef6\u4fdd\u5b58\u5230\u7279\u5b9a\u76ee\u5f55\u4e0b\u3002<\/p>\n<p><strong>\u4f7f\u7528Python\u4e0b\u8f7d\u6587\u4ef6\u65f6\uff0c\u5982\u4f55\u786e\u4fdd\u6587\u4ef6\u540d\u4e0d\u51b2\u7a81\uff1f<\/strong><br \/>\u4e3a\u907f\u514d\u6587\u4ef6\u540d\u51b2\u7a81\uff0c\u53ef\u4ee5\u5728\u4fdd\u5b58\u6587\u4ef6\u524d\u68c0\u67e5\u6587\u4ef6\u662f\u5426\u5df2\u5b58\u5728\u3002\u4f7f\u7528<code>os.path.exists()<\/code>\u65b9\u6cd5\u53ef\u4ee5\u5224\u65ad\u6587\u4ef6\u662f\u5426\u5b58\u5728\uff0c\u5982\u679c\u5b58\u5728\uff0c\u53ef\u4ee5\u4e3a\u6587\u4ef6\u540d\u6dfb\u52a0\u65f6\u95f4\u6233\u6216\u5e8f\u53f7\uff0c\u786e\u4fdd\u6bcf\u6b21\u4e0b\u8f7d\u7684\u6587\u4ef6\u5177\u6709\u552f\u4e00\u6027\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\uff0c\u5982\u4f55\u5904\u7406\u4e0b\u8f7d\u5927\u6587\u4ef6\u7684\u60c5\u51b5\uff1f<\/strong><br \/>\u4e0b\u8f7d\u5927\u6587\u4ef6\u65f6\uff0c\u5efa\u8bae\u4f7f\u7528\u6d41\u5f0f\u4e0b\u8f7d\u7684\u65b9\u5f0f\uff0c\u4ee5\u907f\u514d\u5360\u7528\u8fc7\u591a\u5185\u5b58\u3002\u53ef\u4ee5\u4f7f\u7528<code>requests.get(url, stream=True)<\/code>\u6765\u5b9e\u73b0\u6d41\u5f0f\u4e0b\u8f7d\uff0c\u5e76\u9010\u5757\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u5e76\u5199\u5165\u78c1\u76d8\uff0c\u8fd9\u6837\u53ef\u4ee5\u6709\u6548\u7ba1\u7406\u5185\u5b58\u5e76\u63d0\u9ad8\u4e0b\u8f7d\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684\u65b9\u6cd5\u6765\u6307\u5b9a\u6587\u4ef6\u7684\u4e0b\u8f7d\u4f4d\u7f6e\u3002\u4e00\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u4f7f\u7528requests\u5e93\u8fdb\u884cHTTP [&hellip;]","protected":false},"author":3,"featured_media":1172438,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1172408"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1172408"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1172408\/revisions"}],"predecessor-version":[{"id":1172439,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1172408\/revisions\/1172439"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1172438"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1172408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1172408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1172408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}