How can I avoid "environment hell" in postman?

L42

Say I have two environments (test and production) with two different URLs. I also have two services (serviceA and serviceB) that needs different header values. I could deal with this with four environments in Postman:

  1. testServiceA: url for test, header value for serviceA
  2. testServiceB: url for test, header value for serviceB
  3. productionServiceA: url for production, header value for serviceA
  4. productionServiceB: url for production, header value for serviceB

Here I have duplication of both the URLs and the headers. As I add another url, I need six environments in total:

  1. testServiceA: url for test, header value for serviceA
  2. testServiceB: url for test, header value for serviceB
  3. productionServiceA: url for production, header value for serviceA
  4. productionServiceB: url for production, header value for serviceB
  5. stagingServiceA: url for staging, header value for serviceA
  6. stagingServiceB: url for staging, header value for serviceB

And as I add another service which requires a changed header value, I need another 3:

  1. testServiceA: url for test, header value for serviceA
  2. testServiceB: url for test, header value for serviceB
  3. productionServiceA: url for production, header value for serviceA
  4. productionServiceB: url for production, header value for serviceB
  5. stagingServiceA: url for staging, header value for serviceA
  6. stagingServiceB: url for staging, header value for serviceB
  7. testServiceC: url for test, header value for serviceC
  8. productionServiceC: url for production, header value for serviceC
  9. stagingServiceC: url for staging, header value for serviceC

How can I avoid this? It would be great if I could choose multiple environments as active. Then I could place a checkmark next to "staging" and "serviceC" for example.

Jonathan Montane

For a solution specific to Paw:

Paw makes has the concept of environment domains, which allows for easier control on your environment values. Basically an environment domain can have multiple environments, which are representations of the same environment value.

In your case, you could have 3 environments domains (serviceA, serviceB, serviceC), for which you would have 3 environments (test, staging, production)

Paw environment demo

In general, this allows for a lot of flexibility, as multiple environment domains can be used together in a single request. For instance, one could imagine a Server environment domain with different environments (us-east-1, us-west, ...), which could combine with, say a Version environment domain (v1.0, v1.1, v2.0, etc.), and combine them into a single request to check whether version 2.0 works on us-east-1, and so on.

For a solution specific to Postman:

You can use some {{}} intricacies to supercharge some environments. Environment variables can refer to each other:

Postman environment demo

Now, when you refer to the environment variable {{some-important-header}}somewhere, it will actually refer to the {{{{mode}}-some-important-header}}, which in this case is {{test-some-important-header}}, or -1. Every time you want to change mode, you have to change the environment variable value mode to the correct value, like production, or staging.

It's not cleanest solution, but it avoids creating a bunch of environments due to coupling.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Postman: How can I set my postman to use "pm" instead of "postman"

分類Dev

How can I avoid losing precision with ftFmtBcd?

分類Dev

How can I avoid a circular reference situation

分類Dev

Django conditional queries: How can I avoid this?

分類Dev

How can I avoid duplicate templates in Meteor?

分類Dev

How i can avoid the distinct() of watchdog?

分類Dev

How can I avoid problems with CPU power?

分類Dev

How can I validate JSON array value in postman?

分類Dev

How can I avoid nested Navigation Bars in SwiftUI?

分類Dev

How can I avoid running some tests in parallel?

分類Dev

How can I avoid Phusion Passenger running as root?

分類Dev

How can I avoid using 'at' in radial-gradient?

分類Dev

How can i avoid Jquery translate `?` to `%3F`

分類Dev

How can I avoid overwriting dynamodb from two lambdas?

分類Dev

EXC_BAD_ACCESS - How can I avoid it?

分類Dev

How can i avoid or pass over a directory that is access denied?

分類Dev

How can I avoid repeating the css and not using !important?

分類Dev

How can I avoid a black background when fading in an overlay with ffmpeg?

分類Dev

Can I avoid mutating in this scenario?

分類Dev

How can I see ChromeLogger output in the Postman console when debugging an API?

分類Dev

How can I avoid my program to keep running when I close my main frame?

分類Dev

How can I avoid Firefox's "you have chosen to open" dialog when I try to download a file?

分類Dev

Can I avoid nested namespaces in forward declaration?

分類Dev

Can I avoid using a kubernetes volume

分類Dev

Can I avoid repeat calculation in this query?

分類Dev

How can i avoid a deadlock in Spring when creating a bean while triggering an application event?

分類Dev

How can i avoid a deadlock in Spring when creating a bean while triggering an application event?

分類Dev

How can i avoid a deadlock in Spring when creating a bean while triggering an application event?

分類Dev

How can I avoid "no input files" error from sed, when run from xargs?

Related 関連記事

  1. 1

    Postman: How can I set my postman to use "pm" instead of "postman"

  2. 2

    How can I avoid losing precision with ftFmtBcd?

  3. 3

    How can I avoid a circular reference situation

  4. 4

    Django conditional queries: How can I avoid this?

  5. 5

    How can I avoid duplicate templates in Meteor?

  6. 6

    How i can avoid the distinct() of watchdog?

  7. 7

    How can I avoid problems with CPU power?

  8. 8

    How can I validate JSON array value in postman?

  9. 9

    How can I avoid nested Navigation Bars in SwiftUI?

  10. 10

    How can I avoid running some tests in parallel?

  11. 11

    How can I avoid Phusion Passenger running as root?

  12. 12

    How can I avoid using 'at' in radial-gradient?

  13. 13

    How can i avoid Jquery translate `?` to `%3F`

  14. 14

    How can I avoid overwriting dynamodb from two lambdas?

  15. 15

    EXC_BAD_ACCESS - How can I avoid it?

  16. 16

    How can i avoid or pass over a directory that is access denied?

  17. 17

    How can I avoid repeating the css and not using !important?

  18. 18

    How can I avoid a black background when fading in an overlay with ffmpeg?

  19. 19

    Can I avoid mutating in this scenario?

  20. 20

    How can I see ChromeLogger output in the Postman console when debugging an API?

  21. 21

    How can I avoid my program to keep running when I close my main frame?

  22. 22

    How can I avoid Firefox's "you have chosen to open" dialog when I try to download a file?

  23. 23

    Can I avoid nested namespaces in forward declaration?

  24. 24

    Can I avoid using a kubernetes volume

  25. 25

    Can I avoid repeat calculation in this query?

  26. 26

    How can i avoid a deadlock in Spring when creating a bean while triggering an application event?

  27. 27

    How can i avoid a deadlock in Spring when creating a bean while triggering an application event?

  28. 28

    How can i avoid a deadlock in Spring when creating a bean while triggering an application event?

  29. 29

    How can I avoid "no input files" error from sed, when run from xargs?

ホットタグ

アーカイブ