Jmeter:带有正文数据和文件上传的 Http POST 请求

Rob*_*ois 7 content-type jmeter load-testing mime-types postman

我正在尝试测试一个在邮递员上工作但不在 Jmeter 上工作的 Rest api,请求需要(2 个参数):

  • 一个pdf文件
  • 正文数据(包含 pdf 信息的 json)

在 Postman 上:当我放置 Content-Type = application/x-www-form-urlencoded 并上传 json 文件和 pdf 文件时,它可以工作,但在 jmeter 上我总是收到诸如“不支持的媒体类型”之类的错误

sun*_*teo 1

    \n
  1. 请检查请求(Postman 和 jmeter)的所有值标头和内容类型是否相同。
  2. \n
  3. 检查 \xe2\x80\x9cUse multipart/form-data for POST\xe2\x80\x9d 框未选中。
  4. \n
\n\n
\n

使用 multipart/form-data 或 application/x-www-form-urlencoded post\n 请求

\n
\n\n

参考;- https://jmeter.apache.org/usermanual/component_reference.html#HTTP_Request

\n\n

欲了解更多信息,请查看此博客。

\n\n

希望这可以帮助。

\n