Skip to content

Instantly share code, notes, and snippets.

@raymelon
Last active September 13, 2023 14:41
Show Gist options
  • Save raymelon/bea9b1fb6d75c0f69c28e2edc9f59999 to your computer and use it in GitHub Desktop.
Save raymelon/bea9b1fb6d75c0f69c28e2edc9f59999 to your computer and use it in GitHub Desktop.
postman save response to an enviroment variable
// on Tests tab, enter these
var jsonData = pm.response.json();
if (jsonData["response_field_key"])
pm.environment.set("ENV_VARIABLE_KEY", jsonData.access_token);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment