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

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

问题描述

我创建了一个简单的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}}.

要更新环境变量值,可以使用变量编辑器,或在预请求脚本,其语法为 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.

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

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