http://127.0.0.1:9010/v1/communicationRecord/summary 传递的json参数,是一个响应式的接口,怎么修改这个参数,可以响应式的输出。
为了使用curl命令对您的接口进行流式输出测试,您需要构造一个curl请求,该请求向您的服务发送JSON数据,并且能够接收流式响应。假设您的接口能够处理流式响应(如text/event-stream
),以下是构造curl命令的一个示例:
curl -X POST http://127.0.0.1:9010/v1/communicationRecord/summary \-H "Content-Type: application/json" \-H "Accept: text/event-stream" \-d '[{"roleType": "AGENT", "content": "喂,你好,彭先生,对吧?"}, {"roleType": "CUSTOMER", "content": "对。"}, {"roleType": "AGENT", "content": "哎。"}, {"roleType": "AGENT", "content": "我是那个调解员。"}, {"roleType": "CUSTOMER", "content": "嗯,你好。"}, {"roleType": "AGENT", "content": "哎,你好,是这样的,就是你那个发到调解群里面的,我们这边看到了然后,和原告方这边去沟通过。"}, {"roleType": "AGENT", "content": "原告方这边现在是没办法给你把这个期限延长呃,因为他们第一。"}, {"roleType": "CUSTOMER", "content": "嗯。"}, {"roleType": "CUSTOMER", "content": "到29号嘛29号。"}, {"roleType": "AGENT", "content": "呃,是这个样子的。第一点就是本来这个调解期通常情况下是一个月的时间,调解期本来就延长了两周的一个时间。然后第二点是因为原告方这边这个案件的话,他们是批量进行申请诉讼的。就25过后,25号如果没办法处理的话,26号他们会批量申请到这个立案庭,进行正式的一个立案处理。"}, {"roleType": "CUSTOMER", "content": "嗯。"}, {"roleType": "CUSTOMER", "content": "嗯。"}, {"roleType": "AGENT", "content": "他没办法,就是。"}, {"roleType": "CUSTOMER", "content": "嗯。"}, {"roleType": "AGENT", "content": "把某些当事人或者说他们的一个客户进行分开的。"}, {"roleType": "AGENT", "content": "处理知道吧?"}, {"roleType": "CUSTOMER", "content": "嗯。"}, {"roleType": "CUSTOMER", "content": "嗯。"}, {"roleType": "AGENT", "content": "所以说我就是建议你这边,如果说你是25号呃,29号发工资的话,建议你这边看能不能先周转一下嘛。然后你发了工资再还给别人。"}, {"roleType": "CUSTOMER", "content": "好的好的好的好的。"}, {"roleType": "AGENT", "content": "哎,好的,因为只有这个样子,你处理以后,你这个这两笔欠款的这个减免才能够享受。"}, {"roleType": "CUSTOMER", "content": "好了。"}, {"roleType": "CUSTOMER", "content": "好好好。"}, {"roleType": "AGENT", "content": "哎,好的,那法院指派到我们。"}, {"roleType": "CUSTOMER", "content": "行,我知道了。好。"}]'
此命令的解释如下:
-X POST
:指定请求类型为POST。-H "Content-Type: application/json"
:设置HTTP头以指明发送的数据类型为JSON。-H "Accept: text/event-stream"
:设置HTTP头以指明期望的响应类型为事件流(这取决于您的服务器是否支持)。-d
:后跟要发送的
sunyuhua@sunyuhua-HKF-WXX:~/dockercom/es$ curl -X POST http://127.0.0.1:9010/v1/communicationRecord/summary \-H "Content-Type: application/json" \-H "Accept: text/event-stream" \-d '[{"roleType": "AGENT", "content": "喂,你好,彭先生,对吧?"}, {"roleType": "CUSTOMER", "content": "对。"}, {"roleType": "AGENT", "content": "哎。"}, {"roleType": "AGENT", "content": "我是那个调解员。"}, {"roleType": "CUSTOMER", "content": "嗯,你好。"}, {"roleType": "AGENT", "content": "哎,你好,是这样的,就是你那个发到调解群里面的,我们这边看到了然后,和原告方这边去沟通过。"}, {"roleType": "AGENT", "content": "原告方这边现在是没办法给你把这个期限延长呃,因为他们第一。"}, {"roleType": "CUSTOMER", "content": "嗯。"}, {"roleType": "CUSTOMER", "content": "到29号嘛29号。"}, {"roleType": "AGENT", "content": "呃,是这个 样子的。第一点就是本来这个调解期通常情况下是一个月的时间,调解期本来就延长了两周的一个时间。然后第二点是因为原告方这边这个案件的话,他们是批量进行申请诉讼的。就25过后,25号如果没办法处理的话,26号他们会批量申请 到这个立案庭,进行正式的一个立案处理。"}, {"roleType": "CUSTOMER", "content": "嗯。"}, {"roleType": "CUSTOMER", "content": "嗯。"}, {"roleType": "AGENT", "content": "他没办法,就是。"}, {"roleType": "CUSTOMER", "content": "嗯。"}, {"roleType": "AGENT", "content": "把某些当事人或者说他们的一个客户进行分开的。"}, {"roleType": "AGENT", "content": "处理知道吧?"}, {"roleType": "CUSTOMER", "content": "嗯。"}, {"roleType": "CUSTOMER", "content": "嗯。"}, {"roleType": "AGENT", "content": "所以说我就是建议你这边,如果说你是25号呃,29号发工资的话,建议你这边看能不能先周转一下嘛。然后你发了工资再还给别人。"}, {"roleType": "CUSTOMER", "content": "好的好的好的好的。"}, {"roleType": "AGENT", "content": "哎,好的,因为只有这个样子,你处理以后,你这个这两笔欠款的这个减免才能够享受。"}, {"roleType": "CUSTOMER", "content": "好了。"}, {"roleType": "CUSTOMER", "content": "好好好。"}, {"roleType": "AGENT", "content": "哎,好的,那法院指派到我们。"}, {"roleType": "CUSTOMER", "content": "行,我知道了。好。"}]'
data:{"code":200,"message":"Success","data":"{\"content\":\"调解\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"员\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"与\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"彭先生进行了沟通,\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"了解到彭先生在调解群中提出\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"的问题已经引起注意,并且调解员\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"已与原告方进行了交流。原告\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"方表示无法进一步延长调解期限,\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"因为按照流程,调解期原本是一个\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"月并已额外延长两周,而且\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"他们将采取批量诉讼的方式,即\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"若在25日后还未达成调解\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"协议,将在26日向立案\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"庭提交正式立案申请,无法针对\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"个别当事人进行单独处理。\\n\\n鉴于此\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"情况,调解员建议彭先生尽量\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"在工资发放(预计日期为2\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"5日或29日)后\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"进行还款周转。这样做的话,彭\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"先生才能享受到这两笔欠款可能\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"的减免优惠。彭先生对此表示\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"理解和同意。整个调解过程是由法院\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"指派给调解员进行的。\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"\",\"finishReason\":\"null\"}"}data:{"code":200,"message":"Success","data":"{\"content\":\"\",\"finishReason\":\"stop\"}"}sunyuhua@sunyuhua-HKF-WXX:~/dockercom/es$