我向该网站发出了后期请求并收到了很多回复。问题是它不是经典的 json 格式,而是这样的:
event:conversation.chat.created
data:{"id":"xxxxxxxx","conversation_id":"xxxxxx","bot_id":"Xxxxxxx","created_at":xxxxxxx,"last_error":{"code":0,"msg":""},"status":"created","usage":{"token_count":0,"output_count":0,"input_count":0}}
event:conversation.chat.in_progress
data:{"id":"xxxxxxxxx","conversation_id":"xxxxxxxxxxx","bot_id":"xxxxxxxxxxx","created_at":xxxxxxxx,"last_error":{"code":0,"msg":""},"status":"in_progress","usage":{"token_count":0,"output_count":0,"input_count":0}}
#Заменил значения на 'XXXX'
服务器响应超过 9-10 个,并且全部在一个响应中收到。 Postman 通常会划分它们,而 Python 不会:
当我尝试将所有这些转换为 json via 时responce.json(),它开始给出错误json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
尝试翻译成文本导致我无法添加逗号、删除不必要的\n等等。我应该怎么办?
