浏览代码

v0.5
新增articles接口

罗俊辉 1 年之前
父节点
当前提交
22165ba7f1
共有 1 个文件被更改,包括 30 次插入0 次删除
  1. 30 0
      test/article_dev.py

+ 30 - 0
test/article_dev.py

@@ -0,0 +1,30 @@
+"""
+@author: luojunhui
+"""
+import json
+import time
+import requests
+
+"""
+aic: tencent, meta, kimi
+"""
+
+url = "http://47.99.132.47:8888/article"
+
+body = {
+    "aic": "tencent",
+    "text": "",
+    "title": "高血压可以这样饮食"
+}
+a = time.time()
+header = {
+    "Content-Type": "application/json",
+}
+
+response = requests.post(url, json=body, headers=header, timeout=600)
+b = time.time()
+print(b - a)
+print(json.dumps(response.json(), ensure_ascii=False, indent=4))
+
+# with open("test_return.json", "w", encoding="utf-8") as f:
+#     f.write(json.dumps(response.json(), ensure_ascii=False, indent=4))