我可以设置全局变量,但无法获得。
pm.sendRequest(getLibraries, function (err, response) {
if(!err){
var jsonData = response.json();
console.log('Libraries: ',jsonData);
var lib_id = jsonData.contents[0].id;
console.log('Lib_id:', lib_id);
pm.globals.set("MLSLibrary_id", lib_id);
}
});
var library_id = pm.globals.get("MLSLibrary_id");
console.log('MLSLibrary_id: ', library_id);