<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using CORS Instead of Proxy Page to Query Services in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/using-cors-instead-of-proxy-page-to-query-services/m-p/213194#M1051</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've written some code in JavaScript to query the ArcGIS REST Admin API to query a lit of services on a different domain to where the application is hosted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically the app will make a rest to a URL like this - &lt;A href="http://laptop-sfw.etgnz.eagle.co.nz:6080/arcgis/admin/services?token=IHFgoom_rq5DJ9lU5sXi2AWKRAuTsBMi8lhlYhdPjJI." title="http://laptop-sfw.etgnz.eagle.co.nz:6080/arcgis/admin/services?token=IHFgoom_rq5DJ9lU5sXi2AWKRAuTsBMi8lhlYhdPjJI."&gt;http://SERVER:6080/arcgis/rest/services?token=IHFgoom_rq5DJ9lU5sXi2AWKRAuTsBMi8lhlYhdPjJI.&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get a list of services. The above works fine when I enable CORS like this beforehand:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.config.defaults.io.alwaysUseProxy = false;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.config.defaults.io.corsEnabledServers.push("SERVER:6080");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as soon as I change the url to the REST Admin API instead of the REST services directory i.e. &lt;A href="http://laptop-sfw.etgnz.eagle.co.nz:6080/arcgis/admin/services?token=IHFgoom_rq5DJ9lU5sXi2AWKRAuTsBMi8lhlYhdPjJI." title="http://laptop-sfw.etgnz.eagle.co.nz:6080/arcgis/admin/services?token=IHFgoom_rq5DJ9lU5sXi2AWKRAuTsBMi8lhlYhdPjJI."&gt;http://SERVER:6080/arcgis/admin/services?token=IHFgoom_rq5DJ9lU5sXi2AWKRAuTsBMi8lhlYhdPjJI.&lt;/A&gt; it doesn't work and I get this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;esri.config.defaults.io.proxyUrl is not set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though I've got CORS setup, so does anyone know why the ArcGIS REST services directory is different to the admin API directory when using CORS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Sep 2014 10:19:36 GMT</pubDate>
    <dc:creator>ShaunWeston1</dc:creator>
    <dc:date>2014-09-16T10:19:36Z</dc:date>
    <item>
      <title>Using CORS Instead of Proxy Page to Query Services</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/using-cors-instead-of-proxy-page-to-query-services/m-p/213194#M1051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've written some code in JavaScript to query the ArcGIS REST Admin API to query a lit of services on a different domain to where the application is hosted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically the app will make a rest to a URL like this - &lt;A href="http://laptop-sfw.etgnz.eagle.co.nz:6080/arcgis/admin/services?token=IHFgoom_rq5DJ9lU5sXi2AWKRAuTsBMi8lhlYhdPjJI." title="http://laptop-sfw.etgnz.eagle.co.nz:6080/arcgis/admin/services?token=IHFgoom_rq5DJ9lU5sXi2AWKRAuTsBMi8lhlYhdPjJI."&gt;http://SERVER:6080/arcgis/rest/services?token=IHFgoom_rq5DJ9lU5sXi2AWKRAuTsBMi8lhlYhdPjJI.&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get a list of services. The above works fine when I enable CORS like this beforehand:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.config.defaults.io.alwaysUseProxy = false;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; esri.config.defaults.io.corsEnabledServers.push("SERVER:6080");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as soon as I change the url to the REST Admin API instead of the REST services directory i.e. &lt;A href="http://laptop-sfw.etgnz.eagle.co.nz:6080/arcgis/admin/services?token=IHFgoom_rq5DJ9lU5sXi2AWKRAuTsBMi8lhlYhdPjJI." title="http://laptop-sfw.etgnz.eagle.co.nz:6080/arcgis/admin/services?token=IHFgoom_rq5DJ9lU5sXi2AWKRAuTsBMi8lhlYhdPjJI."&gt;http://SERVER:6080/arcgis/admin/services?token=IHFgoom_rq5DJ9lU5sXi2AWKRAuTsBMi8lhlYhdPjJI.&lt;/A&gt; it doesn't work and I get this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;esri.config.defaults.io.proxyUrl is not set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though I've got CORS setup, so does anyone know why the ArcGIS REST services directory is different to the admin API directory when using CORS?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 10:19:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/using-cors-instead-of-proxy-page-to-query-services/m-p/213194#M1051</guid>
      <dc:creator>ShaunWeston1</dc:creator>
      <dc:date>2014-09-16T10:19:36Z</dc:date>
    </item>
  </channel>
</rss>

