import requests | |
import json | |
# with open("/home/purui/projects/tmp/testing_chat_store.json", "r") as f: | |
# f = f.read() | |
# fileJson = json.loads(f) | |
# 定义API的URL和要发送的数据 | |
url = 'http://localhost:8000/modify_chat_store/' | |
data = { | |
"sessionId": "testUser401", | |
"upMessageBody": "Hi, my name is Kurt", | |
"downMessageBody": "Hi Kurt! Nice to meet you. It’s always fun to chat with someone new. How are you doing today? 😊" | |
} | |
# 发送POST请求 | |
result = "" | |
response = requests.post(url, json=data) | |
print(response.json()) |