Is there a way to make the esri/request synchronous?
esriRequest(url, { responseType: "json", callbackParamName: "callback" }).then(function(response){ console.log(resp); });
Thanks worked like a charm.
Meghan Kulkarni
Although I see you have the dojo class "request/xhr" property of sync set to a boolean value of true, then object still has a .then method promise.
Can you help me understand how this is synchronous please?
Hi Roshni,
I found another solution, I request myself with dojo class "request/xhr".
Regards,
Flavie
var layerInfo = null; var requestURL = layerUrl + "?f=json"; requestXHR(requestURL, { handleAs: "json", sync: true, headers: { "X-Requested-With": null } }).then(function(data){ layerInfo = data; }); return layerInfo;
Hi Flavie,
I had resolved this issue by making an API at my java code. And then call that API from my javascript making call synchronous.
Regards
Roshni
Hy roshni basu,
I ask myslef the same question. Have you found a way to do that?
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.