-
-
Notifications
You must be signed in to change notification settings - Fork 204
Description
Suppose you're trying out an api of the form GET /api/items/{item_id}
. Currently, there's only 2 ways to manipulate item_id
:
- Edit it directly in the URL of the request
- Have it as an environment variable in an
.env
file
I'd argue both of this have serious downsides if you want to be changing item_id
often:
- Editing the request URL means risking saving the request with the hardcoded
item_id
instead of the placeholder, if you're testing and changing other stuff, thus losing the placeholder for future uses, or for sharing the collection. If you want to avoid this, you should reset the URL to the placeholder each time you're done, which is cumbersome. - Having it as an environment variable means if you want to be changing it often, you need to keep switching to a separate editor to modify the
.env
file (good thing, it reloads, but still). It'd also clutter the.env
file with variables which are maybe not needed in an.env
file.
Having a separate widget allowing one to modify per-request variables would allow us to save a request with a {item_id}
or $ITEM_ID
placeholder, and edit it on-the-fly without leaving posting
. This could allow editing only variables related to the current request, or "collection-level" variables (say, stuff that relates to the entire collection but maybe you don't want to keep on an .env
, or even the loaded .env
variables, maybe even saving them to the same .env
file? (A man can dream, but I think the first one would be a great first improvement)