AnsweredAssumed Answered

how to get values returned by esriRequest request Succeeded 

Question asked by jsn on Dec 5, 2016
Latest reply on Dec 5, 2016 by raabram

Hello everyone,

 I am testing a rest web service created in ASP.Net.

The rest service http://localhost:61004/api/value   returns one value:

  "value1"

I am testing also how to call this Restful service from esri javascript 1.38. This is the sample called "requests JSON using esriRequest".

https://developers.arcgis.com/javascript/3/jssamples/data_requestJson.html

 

I just copied it and set up the proxy and changed the default url

esriConfig.defaults.io.proxyUrl = "/proxy/";

dom.byId("url").value = "http://localhost:61004/api/aasis";

and it works!!!

My question now, is how do I get the content of "response" in a local variable to process it. My goal is to save this value in a field, but I do not know how to retrieve it.

     function requestSucceeded(response, io) {

               dom.byId("status").innerHTML = "";

               dojoJson.toJsonIndentStr = " ";

               dom.byId("content").value = dojoJson.toJson(response, true);   <<===============

           }

      

 Thanks

Outcomes