Hi i use typescript for VSTS task extension, i created a function to get the json response from 3rd party server.
async function onlineChecker(projectName:string,checkerName:string){
let endPoint=getEndPoint();
let authHeader=getBasicAuthHeader();
let restClient:rm.RestClient=new rm.RestClient(endPoint);
let options:rm.IRequestOptions=<rm.IRequestOptions>{};
let headers:ifm.IHeaders=options.additionalHeaders||{};
headers["Authorization"]=authHeader;
let res: rm.IRestResponse<boolean>=await restClient.get<boolean>(endPoint,options)
return res;
}
I have another async function but calling to that function is based on value return from first function. How to make calls sync with these async functions or any other approach for this problem?