使用 bombardier 进行服务器基准测试 - 但不能添加 body 参数

Using bombardier for server benchmarking - but can't add body parameters

所以,我在 MacOS Sierra 上使用 bombardier 用于从命令行进行服务器基准测试。 在此示例中,我使用了 1 个连接和 1 个请求,以及两个 headers: "Authorization" 和 "Content-Type" 和 body: "{isTemplate:1}" 但是服务器没有收到 body.

./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