API calls gets stalled until one API call is complete. After first call finishes then second call is hit to API. I want by browser to get response from multiple API methods at a time.
jquery code
var UserMasterId = $('#lblHdnUsrMstId').text();
$.ajax({
url: '/api/CRMLeftSideBarAPI/getMyCalls',
type: 'GET',
data: { UserMasterId: UserMasterId },
beforeSend: function () {
$('.ModalAutocomplete').fadeIn('slow');
},
complete: function () {
$('.ModalAutocomplete').fadeOut('slow');
}
}).done(function (data) {
}).error();
var UserMasterId = $('#lblHdnUsrMstId').text();
$.ajax({
url: '/api/CRMLeftSideBarAPI/getMyUsers',
type: 'GET',
data: { UserMasterId: UserMasterId },
beforeSend: function () {
$('.ModalAutocomplete').fadeIn('slow');
},
complete: function () {
$('.ModalAutocomplete').fadeOut('slow');
}
}).done(function (data) {
}).error();
API code
public string getMyCalls(string UserMasterId)
{
}
public string getMyUsers(string UserMasterId)
{
}
i want to get response for both api calls at a time, not one after the other.
What I have tried:
API calls gets stalled until one API call is complete. After first call finishes then second call is hit to API. I want by browser to get response from multiple API methods at a time.
Do i need to write async await for API method?