所以,我正在使用 bombardier在 MacOS Sierra 上 用于从命令行进行服务器基准测试。 在此示例中,我使用 1 个连接和 1 个请求,以及两个 header : “授权”和“内容类型”和正文:“{isTemplate:1}” 但是服务器没有接收到正文。
./bombardier -c 1 -n 1 -m PATCH -H "Authorization: Bearer MYBEARERGOESHERE" -H "Content-Type: application/x-www-form-urlencoded" -b "{isTemplate:1}" http://localhost:8082/presentation/6525/update
我试过:
-b "{isTemplate:1}"
-b "isTemplate:1"
有什么想法吗?
最佳答案
刚刚找到解决方案,- 你需要像这样编写主体变量:
-b "isTemplate=1"
所以最终要求:
./bombardier -c 1 -n 1 -m PATCH -H "Authorization: Bearer MYBEARERGOESHERE" -H "Content-Type: application/x-www-form-urlencoded" -b "isTemplate=1" http://localhost:8082/presentation/6525/update
关于debugging - 使用 bombardier 进行服务器基准测试 - 但不能添加主体参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53082371/