如何使用Postman将同一键的多个参数值传递给GET [英] How to pass multiple param values for the same key to GET with Postman
问题描述
我是Postman和API的新手。我需要将同一个键的多个参数值传递给Postman的GET。
I'm new to Postman and APIs in general. I have a need to pass multiple param values for the same key to a GET with Postman.
我希望最终结果是与传递给键 id的GET调用的参数值相对应的所有功能的列表。
I want the end result to be a listing of all "features" corresponding to the param values passed to the GET call for the key "id".
我研究了SO和其他板上运气为零的所有排列。我什至使用POST尝试了相同的变体,结果甚至更糟。所以......希望在这里发帖,希望有人能提供帮助。
I've researched and tried every permutation found on SO and other boards with zero luck. I even tried the same variations using POST with even worse results. So....posting here in hopes that someone can help.
这是我到目前为止所尝试的:
Here's what I've tried so far:
获取 https:// URL / api / feature?id = SdxApTWLym1n3D5-hR- QOvwaklo
返回期望的功能
GET https:// URL / api / feature?id = MzqDzjNch3vZ4c9R54I5AtDgwCw
预期功能
获取 https:// URL / api / feature?id = SdxApTWLym1n3D5-hR-QOvwaklo& id = MzqDzjNch3vZ4c9R54I5AtDgwCw
仅返回与SdxApTWLym1相关的功能hR-QOvwaklo
Returns just the feature associated with SdxApTWLym1n3D5-hR-QOvwaklo
返回所有功能
获取 https:// URL / api / feature?where = { id:[ SdxApTWLym1n3D5-hR-QOvwaklo, MzqDzjNch3vZ4c9R54I5AtDgwCw]}
GET https://URL/api/feature?where={"id":["SdxApTWLym1n3D5-hR-QOvwaklo","MzqDzjNch3vZ4c9R54I5AtDgwCw"]}
返回所有功能
我正在做的可能吗?如果是这样,我将不胜感激建议。
Is what I'm doing possible? If so, I'd appreciate suggestions.
谢谢!
推荐答案
在地址栏中输入端点。
在参数选项卡中输入以下值:
Put in Params tab required values:
KEY VALUE
id[] SdxApTWLym1n3D5-hR-QOvwaklo
id[] MzqDzjNch3vZ4c9R54I5AtDgwCw
在POSTMAN中运行请求。
Run the request in the POSTMAN.
这篇关于如何使用Postman将同一键的多个参数值传递给GET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!