快捷请求:一个简单易用的Chrome扩展,允许用户快速发送定制HTTP请求。通过右键菜单,可轻松发送包含当前页面信息的请求,适合将网页的数据快速存储到其他平台。
https://github.com/glwhappen/QuickRequest
模拟后台
可以用这个例子来测试
from flask import Flask, request, jsonify
from flask_cors import CORS
app = Flask(__name__)
CORS(app) # 启用CORS
@app.route('/posts', methods=['POST'])
def posts_endpoint():
# 打印请求体
print("Received request:")
print("Headers:", request.headers)
print("Body:", request.json)
# 返回一个确认响应
return jsonify({"message": "Request received successfully!"})
if __name__ == '__main__':
app.run(debug=True)
请求例子
添加到笔记系统
可以直接在笔记系统里面添加一篇文章,然后把对应的请求复制到postman里面,导出url形式的请求,把对应的内容替换到下面的这个里面,就ok了
curl --location 'http://localhost:5000/posts' \
--header 'authorization: token' \
--header 'content-type: application/json' \
--data '{
"text": "$text$\n\n [$title$]($url$)",
"categoryName": "浏览器添加",
"tagNames": [
"浏览器添加"
]
}'
添加到notion
curl --location 'https://api.notion.com/v1/pages' \
--header 'Notion-Version: 2022-06-28' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer secret_xxxxxxx' \
--data '{
"parent": {
"database_id": "d6fb32a16fc9451ebf5c4f5ce128683b"
},
"properties": {
"word": {
"title": [
{
"text": {
"content": "$text$[$title$]($url$)"
}
}
]
}
}
}'