{"id":7002,"date":"2024-07-21T19:01:08","date_gmt":"2024-07-21T11:01:08","guid":{"rendered":""},"modified":"2024-07-21T19:01:08","modified_gmt":"2024-07-21T11:01:08","slug":"Flask\u6846\u67b6flash\u6d88\u606f\u95ea\u73b0\u5b66\u4e60\u4e0e\u4f18\u5316\u7b26\u5408\u95ea\u73b0\u4e4b\u540d","status":"publish","type":"post","link":"https:\/\/mushiming.com\/7002.html","title":{"rendered":"Flask\u6846\u67b6flash\u6d88\u606f\u95ea\u73b0\u5b66\u4e60\u4e0e\u4f18\u5316\u7b26\u5408\u95ea\u73b0\u4e4b\u540d"},"content":{"rendered":"
\u7b2c\u4e00\u6b21\u77e5\u9053Flask\u6709flash\u8fd9\u4e2a\u529f\u80fd\u65f6\uff0c\u542c\u8fd9\u540d\u5b57\u5c31\u89c9\u5f97\u9ad8\u7aef\uff0c\u6d88\u606f\u95ea\u73b0\u2026\u662f\u8df3\u5200blink\u95ea\u70c1\u8eb2\u6280\u80fd\u7684top10\u64cd\u4f5c\u5417\uff1f\u53ef\u7ed3\u679c\u8ba9\u6211\u597d\u5931\u671b\uff0c\u54ea\u91cc\u6709\u4ec0\u4e48\u95ea\u73b0\u7684\u6548\u679c\uff0c\u4e0d\u8fc7\u662f\u5e73\u5e38\u7684\u6d88\u606f\u4f20\u8f93\u4e0e\u5c55\u793a\u7f62\u4e86\u3002\u90a3\u4e48\u4eca\u5929\u6211\u5c31\u5e26\u7740\u5927\u5bb6\u5728\u5b66\u4e60flash\u529f\u80fd\u7684\u57fa\u7840\u4e0a\uff0c\u589e\u52a0\u95ea\u73b0\u6548\u679c\uff01<\/p>\n
\n\u597d\u7684\u5e94\u7528\u548c\u7528\u6237\u754c\u9762\u7684\u91cd\u70b9\u662f\u56de\u9988\u3002\u5982\u679c\u7528\u6237\u6ca1\u6709\u5f97\u5230\u8db3\u591f\u7684\u53cd\u9988\uff0c\u4ed6\u4eec\u53ef\u80fd\u6700\u7ec8\u4f1a\u5bf9\u60a8\u7684\u5e94\u7528\u4ea7\u751f\u4e0d\u597d\u7684\u8bc4\u4ef7\u3002
Flask \u63d0\u4f9b\u4e86\u4e00\u4e2a\u975e\u5e38\u7b80\u5355\u7684\u65b9\u6cd5\u6765\u4f7f\u7528\u95ea\u73b0\u7cfb\u7edf\u5411\u7528\u6237\u53cd\u9988\u4fe1\u606f\u3002
\u95ea\u73b0\u7cfb\u7edf\u4f7f\u5f97\u5728\u4e00\u4e2a\u8bf7\u6c42\u7ed3\u675f\u7684\u65f6\u5019\u8bb0\u5f55\u4e00\u4e2a\u4fe1\u606f\uff0c\u7136\u540e\u5728\u4e14\u4ec5\u4ec5\u5728\u4e0b\u4e00\u4e2a\u8bf7\u6c42\u4e2d\u8bbf\u95ee\u8fd9\u4e2a\u6570\u636e\u3002\u8fd9\u901a\u5e38\u914d\u5408\u4e00\u4e2a\u5e03\u5c40\u6a21\u677f\u5b9e\u73b0<\/p>\n<\/blockquote>\n\u4ee5\u4e0a\u5185\u5bb9\u6765\u81eaFlask\u5b98\u65b9\u6587\u6863\uff0c\u5bf9flash\u7684\u8bf4\u660ehttp:\/\/docs.jinkan.org\/docs
\u8fd9\u51e0\u53e5\u8bdd\u4f60\u53ea\u9700\u8bb0\u4f4f\u4e24\u70b9\u5373\u53ef\uff1a<\/p>\n\n
- \n
\u4e00\u4e2a\u8bf7\u6c42\u7ed3\u675f\u65f6\u8bb0\u5f55<\/p>\n<\/li>\n
- \n
\u4ec5\u4ec5\u5728\u4e0b\u4e00\u4e2a\u8bf7\u6c42\u4e2d\u8bbf\u95ee<\/p>\n<\/li>\n<\/ul>\n
\u5173\u4e8e\u4ecb\u7ecd\u7684\u8bef\u89e3<\/h4>\n
flash\u4ecb\u7ecd\u4e2d\u8bf4\u4e86\uff0c\u5728\u4e00\u4e2a\u8bf7\u6c42\u7ed3\u675f\u65f6\u8bb0\u5f55flash\uff0c\u7136\u540e\u4ec5\u4ec5\u5728\u4e0b\u4e00\u4e2a\u8bf7\u6c42\u4e2d\u8bbf\u95ee\u3002\u6b64\u5904\u7684\u4e0b\u4e00\u4e2a\u8bf7\u6c42\uff0c\u4e0d\u662f\u4efb\u610f\u7684\u8bf7\u6c42\uff0c\u800c\u662f\u4e0b\u4e00\u6b21\u83b7\u53d6flash\u5185\u5bb9\u7684\u8bf7\u6c42\u3002
\u6765\u770b\u4e00\u4e2a\u4f8b\u5b50:<\/p>\n# -*- coding: utf-8 -*- # @Author : \u738b\u7fd4 # @JianShu : \u6e05\u98cePython # @Date : 2019\/7\/14 22:36 # @Software : PyCharm # @version \uff1aPython 3.7.3 # @File : demo.py from flask import Flask, flash, get_flashed_messages app = Flask(__name__) app.secret_key = 'not guess' @app.route('\/') def index(): flash(\"add flash -- hello Flask\") return \"<h3> Add Flash <\/h3>\" @app.route('\/hello') def hello(): return \"<h3> Hello World <\/h3>\" @app.route('\/read') def read(): return \"<h3> %s <\/h3>\" % get_flashed_messages() if __name__ == '__main__': app.run(port=5001)<\/code><\/pre>\n
\u8fd9\u6bb5\u4ee3\u7801\u6211\u5c31\u4e0d\u4f7f\u7528html\u6a21\u677f\u6e32\u67d3\u7684\uff0c\u53ea\u662f\u901a\u8fc7\u8fd9\u4e2a\u4f8b\u5b50\u8ba9\u5927\u5bb6\u5148\u5bf9flash\u6709\u4e00\u4e2a\u521d\u6b65\u7684\u8ba4\u8bc6\u3002\u5b9e\u73b0\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n
<\/p>\n
\u9996\u6b21\u8bbf\u95eehttp:\/\/127.0.0.1:5001<\/em>\uff0c\u6211\u4eec\u6dfb\u52a0\u4e86flash\uff0c\u4e4b\u540e\u7684\u4e0b\u4e00\u4e2a\u8bf7\u6c42\uff0c\u6211\u4eec\u53bb\u8bbf\u95ee\u4e86\u4e00\u4e2ahello\u7684uri\uff0c\u6b64\u65f6\u6211\u4eec\u7b80\u5355\u8fd4\u56de\u4e86helloworld\uff0c\u90a3\u4e48\u6b64\u65f6\u7684flash\u662f\u5426\u8fd8\u5b58\u5728\uff1f\u63a5\u4e0b\u6765\u6211\u4eec\u53bb\u8bbf\u95ee\u4e86read\u7684uri\uff0c\u8bfb\u53d6\u5230\u4e86flash\u7684\u5185\u5bb9\uff0c\u7136\u540e\u518d\u6b21\u8bbf\u95eeread\u53bb\u8bfb\u53d6flash\u7684\u65f6\u5019\u5df2\u7ecf\u4e3a\u7a7a\u4e86\u2026
\u6240\u4ee5\uff0c\u4e0d\u8981\u88abflash\u5b98\u7f51\u4e2d\u8bf4\u7684\u4ec5\u4ec5\u5728\u4e0b\u4e00\u6b21\u8bf7\u6c42\u7ed9\u8bef\u89e3\u4e86\uff0c\u5e94\u8be5\u662f\u4ec5\u4ec5\u5728\u4e0b\u4e00\u6b21\u83b7\u53d6flash\u7684\u8bf7\u6c42\u4e2d\u83b7\u53d6\u3002\u518d\u6b21\u8bbf\u95ee\u65f6\u6e05\u7a7a\uff0c\u90a3\u4e48flash\u7684\u5b9e\u73b0\u65b9\u5f0f\u662f\u4ec0\u4e48\u5462\uff1f\u5176\u5b9e\u5f88\u7b80\u5355\u2026<\/p>\nflash\u5b9e\u73b0\u539f\u7406<\/h4>\n
flash\u7684\u5b9e\u73b0\u539f\u7406\uff0c\u5176\u5b9e\u5c31\u662f\u7b80\u5355\u7684\u5728\u6d4f\u89c8\u5668\u4e2d\u6dfb\u52a0session\u4e0e\u5220\u9664session\u8fd9\u4e48\u7b80\u5355\uff0c\u5177\u4f53\u5982\u4f55\u64cd\u4f5c\u7684\u5462\uff1f
flash \u65b9\u6cd5:<\/p>\ndef flash(message, category='message'): flashes = session.get('_flashes', []) flashes.append((category, message)) session['_flashes'] = flashes message_flashed.send(current_app._get_current_object(), message=message, category=category)<\/code><\/pre>\n
get_flashed_messages \u65b9\u6cd5\uff1a<\/p>\n
def get_flashed_messages(with_categories=False, category_filter=[]): flashes = _request_ctx_stack.top.flashes if flashes is None: _request_ctx_stack.top.flashes = flashes = session.pop('_flashes') \\ if '_flashes' in session else [] if category_filter: flashes = list(filter(lambda f: f[0] in category_filter, flashes)) if not with_categories: return [x[1] for x in flashes] return flashes<\/code><\/pre>\n
\u5176\u4ed6\u7684\u5185\u5bb9\u4f60\u90fd\u53ef\u4ee5\u5ffd\u7565\uff0c\u53ea\u8981\u5173\u6ce8\u4e24\u70b9\u5373\u53ef:
flashes = session.get(\u2018_flashes\u2019, []) ; flashes.append((category, message))<\/em>
session.pop(\u2018_flashes\u2019)<\/em>
\u8fd9\u4e48\u770b\u662f\u4e0d\u4e00\u76ee\u4e86\u7136\uff0cflash\u7684\u65f6\u5019\u7ed9session\u4e2d\u585e\u5165\u4e00\u4e2a_flashes\u7684list\uff0c\u7136\u540e\u5f00\u59cbappend\uff0cget_flashed_messages\u7684\u65f6\u5019\u628asession\u4e2d\u7684_flashes pop\u51fa\u6765\uff0c\u5373\u8fbe\u5230\u4e86\u6700\u7ec8\u7684\u8bf7\u6c42\u7ed3\u675f\u524d\u8bbe\u7f6e\uff0c\u4ec5\u4f9b\u4e0b\u4e00\u6b21\u83b7\u53d6flash\u65f6\u4f7f\u7528\u2026
\u90a3\u4e48\u65e2\u7136\u770b\u4e86\u6e90\u7801\uff0c\u5927\u5bb6\u80af\u5b9a\u6ce8\u610f\u5230\u4e00\u4e2acategory\u7684\u53c2\u6570\uff0c\u8fd9\u4e2a\u662f\u7528\u6765\u5e72\u561b\u7684\uff1f<\/p>\ncategory\u53c2\u6570\u64cd\u4f5c<\/h4>\n
flash\u6d88\u606f\u65e2\u7136\u662f\u7528\u4e8e\u6d88\u606f\u95ea\u73b0\uff0c\u5fc5\u7136\u6709\u597d\u6d88\u606f\u3001\u574f\u6d88\u606f\u4e0e\u9ed8\u8ba4\u6d88\u606f\uff0c\u7cfb\u7edf\u9ed8\u8ba4\u7684category=\u2019message\u2019<\/em>\uff0c\u90a3\u4e48\u5982\u679c\u6211\u4eec\u5c06category\u8bbe\u7f6e\u4e3a\u5176\u4ed6\u7c7b\u578b\u5462\uff1f
\u6bd4\u5982flash(\u2018\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef\u2026\u2019, category=\u2019error\u2019)<\/em>\uff0c\u90a3\u4e48\u6211\u4eec\u5728\u6a21\u677f\u4e2d\u9488\u5bf9flash\u53ef\u4ee5\u505a\u4e9b\u4ec0\u4e48\u4e8b\u60c5\uff1f<\/p>\n\u5206\u7c7b\u5c55\u793a<\/h4>\n
get_flashed_messages(with_categories=true)<\/em>
with_categories=true\u4ee3\u8868\u6211\u4eec\u542f\u7528\u6d88\u606f\u5206\u7c7b\uff0c\u4e4b\u540e\u9488\u5bf9\u6d88\u606f\u7c7b\u578b\uff0c\u53ef\u4ee5\u8fdb\u884c\u76f8\u5173\u7684\u8fc7\u6ee4\u64cd\u4f5c<\/p>\n{% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} <ul class=flashes> {% for category, message in messages %} <li class=\"{ \n { category }}\">{ \n { message }}<\/li> {% endfor %} <\/ul> {% endif %} {% endwith %}<\/code><\/pre>\n
\u8fc7\u6ee4\u6d88\u606f<\/h4>\n
get_flashed_messages(category_filter=[\u201cerror\u201d]<\/em><\/p>\n
{% with errors = get_flashed_messages(category_filter=[\"error\"]) %} {% if errors %} <div class=\"alert-message block-message error\"> <a class=\"close\" href=\"#\">\u00d7<\/a> <ul> {%- for msg in errors %} <li>{ \n { msg }}<\/li> {% endfor -%} <\/ul> <\/div> {% endif %} {% endwith %}<\/code><\/pre>\n
\u8fd9\u4e2a\u5c31\u6bd4\u8f83\u7b80\u5355\u4e86\uff0c\u4e3amessage\u6dfb\u52a0\u4e00\u4e2a\u8fc7\u6ee4\u5668\uff0c\u5728\u65e5\u5e38\u4e2d\uff0c\u6211\u4eec\u5b8c\u5168\u53ef\u4ee5\u91cd\u5199\u81ea\u5df1\u7684\u65b9\u6cd5\u2026<\/p>\n
\u7efc\u5408\u4f8b\u5b50<\/h4>\n
\u4ecb\u7ecd\u4e86\u8fd9\u4e48\u591a\uff0c\u6211\u4eec\u6765\u8bbe\u8ba1\u4e00\u4e2a\u6848\u4f8b\uff0c\u7b80\u5355\u7684\u7528\u6237\u767b\u5f55\u754c\u9762\uff0c\u5982\u679c\u7528\u6237\u8f93\u5165\u7684\u7528\u6237\u540d\u5bc6\u7801\u9519\u8bef\uff0c\u5219\u663e\u793a\u9519\u8bef\u6d88\u606f\uff0c\u5982\u679c\u7528\u6237\u767b\u5f55\u6210\u529f\u5219\u8df3\u8f6c\u9875\u9762\uff0c\u5e76\u6b22\u8fce\u4e00\u4e0b\u5c0f\u76c6\u53cb\u3002\u56e0\u4e3a\u767b\u5f55\u548c\u8df3\u8f6c\u9875\u9762\u90fd\u9700\u8981\u4f7f\u7528\u5230flash\uff0c\u5219\u521b\u5efa\u4e00\u4e2abase.html\u7684\u6a21\u677f<\/p>\n
<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>BreezePython<\/title>\n<\/head>\n<body>\n{% block info %}{% endblock %}\n{% with messages = get_flashed_messages(with_categories=true) %}\n {% if messages %}\n <ul class=flashes>\n {% for category, message in messages %}\n {% if category =='error'%}\n <li style=\"color:red\">{\n \n \n { message }}<\/li> {% else %} <li style=\"color:green\">{ \n { message }}<\/li>\n {% endif %}\n {% endfor %}\n <\/ul>\n {% endif %}\n{% endwith %}\n<\/body>\n<\/html><\/code><\/pre>\n
\u4e4b\u540e\u5206\u522b\u5728\u767b\u5f55\u548c\u6b22\u8fce\u9875\u9762\u5f15\u5165\u8be5\u6a21\u677f\u2026
login.html:<\/p>\n{% extends \"base.html\" %}\n{% block info %}\n<h2>\u6b22\u8fce\u767b\u9646\u7cfb\u7edf<\/h2>\n<form action=\"\" method=post>\n <dl>\n <dt>\u7528\u6237\u540d:\n <dd><input type=text name=username value=\"{\n \n \n { request.form.username }}\"> <dt>\u5bc6\u7801: <dd><input type=password name=password> <\/dl> <p><input type=submit value=Login> <\/form> {% endblock %}<\/code><\/pre>\n
index.html<\/p>\n
{% extends \"base.html\" %}\n{% block info %}\n<h2>\u606d\u559c {\n \n \n {user}} ,\u60a8\u5df2\u767b\u9646\uff01<\/h2> {% endblock %}<\/code><\/pre>\n
\u7136\u540e\u521b\u5efaapp.py\u8fdb\u884c\u8c03\u5ea6\uff1a<\/p>\n
# -*- coding: utf-8 -*-\n# @Author : \u738b\u7fd4\n# @JianShu : \u6e05\u98cePython\n# @Date : 2019\/7\/14 23:17\n# @Software : PyCharm\n# @version \uff1aPython 3.7.3\n# @File : app.py\n\nfrom flask import Flask, flash, redirect, render_template, \\\n request, url_for\n\napp = Flask(__name__)\napp.secret_key = 'not guess'\n\n\n@app.route('\/', methods=['GET', 'POST'])\ndef login():\n if request.method == 'POST':\n if request.form['username'] != 'qingfeng' or \\\n request.form['password'] != 'python':\n flash('\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef...', category='error')\n flash('\u4e0a\u70b9\u5fc3\u518d\u8f93\u5165\u4e00\u6b21...', category='error')\n else:\n flash('\u767b\u9646\u6210\u529f', category='info')\n return render_template('index.html', user=request.form['username'])\n return render_template('login.html')\n\n\nif __name__ == \"__main__\":\n app.run()<\/code><\/pre>\n
\u5b9e\u73b0\u6548\u679c\u5982\u4e0b\uff1a
<\/p>\n\u6211\u4eec\u5728base.html\u4e2d\u9488\u5bf9\u4e0d\u540c\u7c7b\u578b\u7684\u6d88\u606f\u8fdb\u884c\u4e86\u989c\u8272\u7684\u8fc7\u6ee4\uff0c\u4e3a\u4e86\u8ba9\u5927\u5bb6\u4e86\u89e3flash\u5176\u5b9e\u662f\u4e00\u4e2a\u5217\u8868\uff0c\u6240\u4ee5\u6dfb\u52a0\u4e86\u4e24\u6761\u9519\u8bef\u4fe1\u606f\u3002
\u5e0c\u671b\u8fd9\u4e2a\u5b9e\u4f8b\u80fd\u8ba9\u5927\u5bb6\u5bf9flash\u6709\u8fdb\u4e00\u6b65\u7684\u4e86\u89e3\u3002<\/p>\nflash\u5982\u4f55\u95ea\u73b0\uff1f<\/p>\n
\u4e3a\u4e86\u53ef\u4ee5\u8ba9flash\u771f\u7684\u5982\u4f55\u95ea\u73b0\u4e4b\u540d\uff0c\u6211\u4eec\u5e94\u8be5\u8ba9flash\u6d88\u606f\uff0c\u51fa\u73b0\u8df3\u5200\u95ea\u70c1\u6d88\u5931\u7684\u6548\u679c\uff0c\u5982\u4f55\u6765\u505a\uff1f\u7b80\u5355\u7684\u4f7f\u7528jQuery\u5373\u53ef\uff01\u53ea\u9700\u4e24\u884c\u4ee3\u7801
base.html:<\/p>\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>BreezePython<\/title>\n<\/head>\n<body>\n{% block info %}{% endblock %}\n<div class=\"flash\">\n{% with messages = get_flashed_messages(with_categories=true) %}\n {% if messages %}\n <ul class=flashes>\n {% for category, message in messages %}\n {% if category =='error'%}\n <li style=\"color:red\">{\n \n \n { message }}<\/li> {% else %} <li style=\"color:green\">{ \n { message }}<\/li>\n {% endif %}\n {% endfor %}\n <\/ul>\n {% endif %}\n{% endwith %}\n<\/div>\n<script src=\"https:\/\/cdn.bootcss.com\/jquery\/3.4.1\/jquery.min.js\"><\/script>\n<script>$(\".flash\").fadeOut(3000);<\/script>\n<\/body>\n<\/html><\/code><\/pre>\n
\u6211\u4eec\u901a\u8fc7jQuery\u81ea\u5e26\u7684fadeOut\u52a8\u753b\u6548\u679c\uff0c\u5373\u53ef\u8fbe\u5230\u6211\u4eec\u7684\u95ea\u73b0\u7684\u6548\u679c<\/p>\n
<\/p>\n
\u8fd9\u624d\u7b26\u5408flash\u7684\u4e4b\u540d\u554a\u2026.<\/p>\n
The End<\/p>\n
\u4eca\u5929\u7684flask\u6846\u67b6flash\u6d88\u606f\u95ea\u73b0\u5c31\u5e26\u5927\u5bb6\u5b66\u4e60\u5230\u8fd9\u91cc\uff0c\u5982\u679c\u89c9\u5f97\u5185\u5bb9\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff0c\u53ef\u4ee5\u70b9\u51fb\u6587\u7ae0\u53f3\u4e0b\u89d2\u7684\u201c\u5728\u770b\u201d\u3002
\u6b22\u8fce\u5c06\u8fd9\u7bc7\u6587\u7ae0\u6216\u6211\u7684\u5fae\u4fe1\u516c\u4f17\u53f7\u3010\u6e05\u98cePython\u3011\u5206\u4eab\u7ed9\u66f4\u591a\u559c\u6b22python\u7684\u4eba\uff0c\u8c22\u8c22\u3002<\/p>\n\u4f5c\u8005\uff1a\u6e05\u98cePython<\/p>\n","protected":false},"excerpt":{"rendered":"Flask\u6846\u67b6flash\u6d88\u606f\u95ea\u73b0\u5b66\u4e60\u4e0e\u4f18\u5316\u7b26\u5408\u95ea\u73b0\u4e4b\u540dFlask\u7684flash\u7b2c\u4e00\u6b21\u77e5\u9053Flask\u6709flash\u8fd9\u4e2a\u529f\u80fd\u65f6\uff0c\u542c\u8fd9\u540d\u5b57\u5c31\u89c9\u5f97\u9ad8\u7aef\uff0c\u6d88\u606f\u95ea...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/7002"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=7002"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/7002\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=7002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=7002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=7002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}