<?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 esriRequest and the urban api? in ArcGIS Urban API Questions</title>
    <link>https://community.esri.com/t5/arcgis-urban-api-questions/esrirequest-and-the-urban-api/m-p/1077682#M1</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using the ArcGIS Urban API in a js app. I make requests to the urban api through esriRequest. Everything has been working well since April. However, last Thursday evening (July &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; around 10:30 PM PST, the esriRequest code started throwing a status 400 message -&lt;/P&gt;&lt;P&gt;"Syntax Error: Cannot parse the unexpected character \"%\"."&lt;/P&gt;&lt;P&gt;Nothing changed with the code, it just started failing. It's basically doing this -&lt;/P&gt;&lt;P&gt;{urbanModels {title id owner}}&lt;/P&gt;&lt;P&gt;Here's an &lt;A href="https://codepen.io/beeflips/pen/jOmVPZv" target="_blank" rel="noopener"&gt;excerpt&lt;/A&gt;. (codepen)&lt;/P&gt;&lt;P&gt;I can copy the request from the profiler and run it successfully in the graqhql playground.&lt;/P&gt;&lt;P&gt;So did something change with esriRequest? It seems like the urban api has not been updated since February.&lt;/P&gt;&lt;P&gt;Or do I need to rewrite this using one of &lt;A href="https://graphql.org/code/#javascript" target="_self"&gt;these libraries&lt;/A&gt;?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jul 2021 06:00:21 GMT</pubDate>
    <dc:creator>RobStauder</dc:creator>
    <dc:date>2021-07-12T06:00:21Z</dc:date>
    <item>
      <title>esriRequest and the urban api?</title>
      <link>https://community.esri.com/t5/arcgis-urban-api-questions/esrirequest-and-the-urban-api/m-p/1077682#M1</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using the ArcGIS Urban API in a js app. I make requests to the urban api through esriRequest. Everything has been working well since April. However, last Thursday evening (July &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; around 10:30 PM PST, the esriRequest code started throwing a status 400 message -&lt;/P&gt;&lt;P&gt;"Syntax Error: Cannot parse the unexpected character \"%\"."&lt;/P&gt;&lt;P&gt;Nothing changed with the code, it just started failing. It's basically doing this -&lt;/P&gt;&lt;P&gt;{urbanModels {title id owner}}&lt;/P&gt;&lt;P&gt;Here's an &lt;A href="https://codepen.io/beeflips/pen/jOmVPZv" target="_blank" rel="noopener"&gt;excerpt&lt;/A&gt;. (codepen)&lt;/P&gt;&lt;P&gt;I can copy the request from the profiler and run it successfully in the graqhql playground.&lt;/P&gt;&lt;P&gt;So did something change with esriRequest? It seems like the urban api has not been updated since February.&lt;/P&gt;&lt;P&gt;Or do I need to rewrite this using one of &lt;A href="https://graphql.org/code/#javascript" target="_self"&gt;these libraries&lt;/A&gt;?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 06:00:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-urban-api-questions/esrirequest-and-the-urban-api/m-p/1077682#M1</guid>
      <dc:creator>RobStauder</dc:creator>
      <dc:date>2021-07-12T06:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: esriRequest and the urban api?</title>
      <link>https://community.esri.com/t5/arcgis-urban-api-questions/esrirequest-and-the-urban-api/m-p/1078732#M2</link>
      <description>&lt;P&gt;Hi Rob&lt;/P&gt;&lt;P&gt;It seems that your request does not have the correct content-type and a proper JSON body.&lt;BR /&gt;I see "content-type: application/x-www-form-urlencoded" in the request headers from your codepen.&lt;BR /&gt;&lt;BR /&gt;We did some changes to the Urban API infrastructure last week. It could be that the previous infrastructure somehow handled "application/x-www-form-urlencoded" requests and the new one does not anymore.&lt;BR /&gt;&lt;BR /&gt;I updated your codepen to make it work again:&lt;BR /&gt;&lt;A href="https://codepen.io/santsches/pen/PomWVMj" target="_blank" rel="noopener"&gt;https://codepen.io/sandromartis/pen/PomWVMj&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Notice the options for esriRequest:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const options = {
  method: "post",
  body: JSON.stringify({
    "query": "{urbanModels{title}}"
  })		
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Let me know if that works for you.&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Sandro&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 16:01:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-urban-api-questions/esrirequest-and-the-urban-api/m-p/1078732#M2</guid>
      <dc:creator>SandroMartis</dc:creator>
      <dc:date>2021-07-14T16:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: esriRequest and the urban api?</title>
      <link>https://community.esri.com/t5/arcgis-urban-api-questions/esrirequest-and-the-urban-api/m-p/1079049#M3</link>
      <description>&lt;P&gt;That worked! Thanks so much Sandro. I appreciate the help and guidance.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 02:17:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-urban-api-questions/esrirequest-and-the-urban-api/m-p/1079049#M3</guid>
      <dc:creator>RobStauder</dc:creator>
      <dc:date>2021-07-15T02:17:05Z</dc:date>
    </item>
  </channel>
</rss>

