# Can I use pm.sendRequest() to send requests synchronously?

**URL:** <https://community.postman.com/t/can-i-use-pm-sendrequest-to-send-requests-synchronously/225>\
**Category:** Help Hub\
**Created:** [November 14, 2017, 3:12pm UTC](https://community.postman.com/t/can-i-use-pm-sendrequest-to-send-requests-synchronously/225 "2017-11-14T15:12:11Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![hock1szabol329](https://avatars.discourse-cdn.com/v4/letter/h/4491bb/32.png) [@hock1szabol329](https://community.postman.com/u/hock1szabol329)\
**Post date:** [July 17, 2018, 2:16pm UTC](https://community.postman.com/t/can-i-use-pm-sendrequest-to-send-requests-synchronously/225/11 "2018-07-17T14:16:35Z")

</div>

you can with javascript promise - await mechanism. even iterations is possible.  
//------------------sandos---------------------------  
function SendRequest(maxRequest) {  
return new Promise(resolve =\> {  
pm.sendRequest({ … },  
function(err, res) {  
var response = JSON.stringify(res);  
console.log("res: " + pinresponse);  
if (maxRequest\>1) {  
SendRequest(maxRequest-1);  
} else {  
resolve(1);  
}  
}  
);  
});  
}

async function SenReq(maxRequest) {  
return await SendRequest(maxRequest);  
}  
//Engineered with Sandos chan

---

_[View the full topic](https://community.postman.com/t/can-i-use-pm-sendrequest-to-send-requests-synchronously/225)._
