Export - edit href in JSON response

316
5
03-05-2020 02:24 AM
NatashaManzuiga
Occasional Contributor

Hi, I'm using Web AppBuilder and to add a Layer I use EXPORT POST because my request is longer then 2000 characters.

In the response I'm getting something like this....

{ "href": "https://atlantic/arcgisoutput/_ags_map42ef5eae899942a9b564138e184a55c9.png", "width": 400, "height": 400, "extent": { "xmin": -109.55, "ymin": 25.76, "xmax": -86.39, "ymax": 49.94, "spatialReference": { "wkid": 4326, "latestWkid": 4326 } }, "scale" : 2.53E7 }

Is it a part where I can change href parameter? because the url I'm getting is not reacheable from my app...it's proxed...so I just have to change the href parameter when I load the image..

Thank you in advance,

Naty

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Naty,

   Hmm. You have to be doing something with the response in your code, so why not just update the url using a simple js string.replace method there?

0 Kudos
Noah-Sager
Esri Regular Contributor

You could also use a RequestInterceptor if you want to be fancy with the response:

API Reference: AfterInterceptorCallback

0 Kudos
NatashaManzuiga
Occasional Contributor

Hi Noah and where can I put this  RequestInterceptor in WAB AppBuilder?

I'm interested on this solution.

When I'm using in the map....for each call I have to use this RequestInterceptor?

Thanks in advance,

Naty

0 Kudos
Noah-Sager
Esri Regular Contributor

Sorry, I'm not sure where in the WAB app that should go, I haven't cracked open the WAB code in a while. You would create a kind of rule for the RequestInterceptor, which should be described in the documentation. Hope this helps.

0 Kudos
NatashaManzuiga
Occasional Contributor

Robert, I fixed it editing  init.js.

Thanks, 

Naty

0 Kudos