Postman - 如何使用不同的参数值发送相同的请求 [英] Postman - How the send the same request with different param values

查看:56
本文介绍了Postman - 如何使用不同的参数值发送相同的请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个简单的 API,我想测试具有不同参数值的请求的响应.有没有一种方法可以发送具有不同参数值的相同请求,而无需为每个参数值组合发送不同的请求?

I created a simple API and I want to test the responses for requests with different parameter values. Is there a way to send the same request with different parameter values without sending a different request for every combination of param values?

推荐答案

您可以将参数值保存为 环境变量,然后在参数文本编辑器中使用这种语法{{variableName}}.

You can save your parameter values as environment variables, and then use them in the parameter text editor with this syntax {{variableName}}.

要更新环境变量值,您可以使用 变量编辑器或在 pre-request script 使用这种语法 pm.environment.set("variableName", variableValue).

To update the environment variable values, you can either use the variables editor or set the value in a pre-request script with this syntax pm.environment.set("variableName", variableValue).

这样就可以发送同一个请求,但参数值不同.

In this way, you can send the same request with different parameter values.

这篇关于Postman - 如何使用不同的参数值发送相同的请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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