<?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 Queries are adding characters to REST service URLs in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/queries-are-adding-characters-to-rest-service-urls/m-p/85179#M7723</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a JS application hosted at myapp.domain.com. A little while ago, I decided to host web adaptor on the same domain as my JS application. So, the root of the web adaptor is myapp.domain.com/arcgis. This was helpful so that I can run staging and production GIS servers and set the base URL to various REST services as just "/arcgis/". It seemed like a reasonable place to use a relative path like that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I just noticed a really weird behavior. When I turn on a layer with the layer-list widget, instead of sending a query to myapp.domain.com/arcgis/rest/myservice/mapserver/0, it sends the request to&amp;nbsp;&lt;SPAN&gt;myapp.domain.com/arcgis/rest/myservice/mapserver/0/0 (note the extra trailing "/0"). In this example, I'm turning on the 0 sublayer of the particular map service.&amp;nbsp;There are a lot of places in the code where I create querytasks and those aren't affected by this problem. If I switch out the base url of "/arcgis/" for "myapp.domain.com/arcgis/" the problem goes away.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So, for some reason it's doing this if the URLs use relative paths, but not if they use a complete path. Anyone have an idea why this is happening?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;EDIT: JS API version 4.14&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jul 2020 18:40:05 GMT</pubDate>
    <dc:creator>CharlieElverson</dc:creator>
    <dc:date>2020-07-23T18:40:05Z</dc:date>
    <item>
      <title>Queries are adding characters to REST service URLs</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/queries-are-adding-characters-to-rest-service-urls/m-p/85179#M7723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a JS application hosted at myapp.domain.com. A little while ago, I decided to host web adaptor on the same domain as my JS application. So, the root of the web adaptor is myapp.domain.com/arcgis. This was helpful so that I can run staging and production GIS servers and set the base URL to various REST services as just "/arcgis/". It seemed like a reasonable place to use a relative path like that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I just noticed a really weird behavior. When I turn on a layer with the layer-list widget, instead of sending a query to myapp.domain.com/arcgis/rest/myservice/mapserver/0, it sends the request to&amp;nbsp;&lt;SPAN&gt;myapp.domain.com/arcgis/rest/myservice/mapserver/0/0 (note the extra trailing "/0"). In this example, I'm turning on the 0 sublayer of the particular map service.&amp;nbsp;There are a lot of places in the code where I create querytasks and those aren't affected by this problem. If I switch out the base url of "/arcgis/" for "myapp.domain.com/arcgis/" the problem goes away.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So, for some reason it's doing this if the URLs use relative paths, but not if they use a complete path. Anyone have an idea why this is happening?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;EDIT: JS API version 4.14&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2020 18:40:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/queries-are-adding-characters-to-rest-service-urls/m-p/85179#M7723</guid>
      <dc:creator>CharlieElverson</dc:creator>
      <dc:date>2020-07-23T18:40:05Z</dc:date>
    </item>
  </channel>
</rss>

