Categories
tech

Configuring Multi Cluster Setup in Postman

Author profile picture

@arvindkgsArvind Kumar GS

Passionate device developer, Linux fanatic, blank code crusader, DIY suggest, Tech Evangelist

If you’re checking out REST APIs application with Oauth on Postman, in most cases you do the next,

  • Send a OAUTH request to an /auth endpoint and copying the entry token, and environment header as ‘Bearer <access-token>’ in precise request.
  • This copy-paste be have shyed away from should you set following (*5*)pre-request script in pre-request tab
    This will execute the Oauth request earlier than executing the true REST
    API, and retailer in an international variable. So consecutive calls will make the most of
    the saved world variable.

Above works nice for a unmarried cluster setup.

However for a multi cluster setup, the place you might have one cluster in say EU knowledge middle, some other in US, then you would have to reproduction this setup. I’ve noticed builders Postman flooded with loads of an identical requests, with simplest alternate being the URL, like underneath with over 184 requests

This can also be have shyed away from through the use of atmosphere variables.

I’ve changed the pre-request script to retailer the entry tokens, refresh token as a worth object in a map with key being the cluster url. This url is ready by way of the surroundings variables.

So now I will be able to transfer to other clusters simply through switching the surroundings.

Author profile picture

Read my tales

Passionate device developer, Linux fanatic, blank code crusader, DIY suggest, Tech Evangelist

Tags

Join iandroid.eu

Create your loose account to free up your customized studying revel in.