how to pass data between requests in api

Solutions on MaxInterview for how to pass data between requests in api by the best coders in the world

showing results for - "how to pass data between requests in api"
Juan Diego
16 May 2016
1To pass data between requests in postman
2
3I would use Enviroment or Global Variable
4Lets say I want to pass my token between
5requests. Than I would create empty global
6variable and save the entire token response
7as json and print the accessToken from 
8response and set the value of global variable
9to json field by writing like for example:
10
11var responseJson = pm.response.json(); 
12console.log( responseJson.accessToken  );
13pm.globals.set("my_secret_token",  responseJson.accessToken );