如何在使用 Jmeter 调用 API 时传递表单数据? [英] How to pass form-data while calling API using Jmeter?

查看:29
本文介绍了如何在使用 Jmeter 调用 API 时传递表单数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 Jmeter 进行 API 调用.

在我的 API 调用中,我发送了一个带有请求的文件,我需要将文件名指定为表单数据.

例如当我从邮递员那里调用相同的 API 时!

当我从 Jmeter 进行上述调用时,如何指定文件名?

Jmeter 调用:

解决方案

指南中的详细解释和配置说明.

I want to make an API call using Jmeter.

In my API call, I'm sending a file with a request, and I need to specify the file name as form-data.

e.g. when I call the same API from postman !

How do I, specify a filename when I make above call from Jmeter?

Jmeter call :

解决方案

HTTP Request Sampler provides options to

  • set Use multipart/form-data for HTTP POST
  • send files with the request

See Performance testing: Upload and Download Scenarios with Apache JMeter guide for detailed explanations and configuration instructions.

这篇关于如何在使用 Jmeter 调用 API 时传递表单数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆