我正在尝试测试我的应用程序是否可以同时处理多个带有自定义标头的 POST 请求。
我知道这个答案,并行运行多个 curl 命令,但它并不能完全满足我的需求:
我想发送多个预定义的 post 请求(请求主体在 .json 文件中定义),并且我想一次发送它们。
这就是我要去的地方。我错过了什么,或者这是执行此任务的合理方式吗?
curl --parallel --parallel-immediate --parallel-max 3 -u user:password -X POST -H "Content-Type: application/json" --data @data1.json -H "customheader: customheader1" http://localhost:8000/rest/api/2/entity/ -X POST -H "Content-Type: application/json" --data @data2.json -H "customheader: customheader2" http://localhost:8000/rest/api/2/entity/ -X POST -H "Content-Type: application/json" --data @data3.json -H "customheader: customeheader1" http://localhost:8000/rest/api/2/entity/
非常感谢!