【问题标题】:How to test POST requests with h2load (nghttp2)如何使用 h2load (nghttp2) 测试 POST 请求
【发布时间】:2022-01-12 05:21:46
【问题描述】:

我正在使用 h2load (nghttp2) 来测试 PHP 服务的服务器。请求类型应为 POST。

我使用以下命令,但在服务器中得到错误:

h2load http://192.168.10.190:8009/echoservice/ping \
  -d post_data \
  -H 'content-type: application/x-www-form-urlencoded' \
  -t 12 -c 400 -n1000

无效请求(格式错误的 HTTP 请求)

文件 post_data 包含字符串:

msg=FromClient

这个命令有什么问题?

更新 1:

当我将 h2load 用于 GET 请求时,我也会得到 Invalid request (Malformed HTTP request)wrk 测试成功。因此,服务器没有问题!

如果是gRPC,h2load 测试成功。

【问题讨论】:

    标签: post server nghttp2 wrk


    【解决方案1】:

    使用-H, --header=<HEADER> 选项并将:method 设置为POST

    -H: ':method: POST'
    

    【讨论】:

      猜你喜欢
      • 2012-06-22
      • 2023-03-05
      • 1970-01-01
      • 2020-03-26
      • 2017-10-28
      • 1970-01-01
      • 1970-01-01
      • 2019-06-16
      • 1970-01-01
      相关资源
      最近更新 更多