<?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 Re: Axios Node.js Code Issue: Unexpected Behavior in API Request in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/axios-node-js-code-issue-unexpected-behavior-in/m-p/1349761#M82770</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/648697"&gt;@hectorsalamanca&lt;/a&gt; you might try using esriRequest instead, it uses native fetch: &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Here's a working example that uses the pattern: &lt;A href="https://github.com/Esri/jsapi-resources/blob/main/esm-samples/jsapi-node/src/request.mjs" target="_blank"&gt;https://github.com/Esri/jsapi-resources/blob/main/esm-samples/jsapi-node/src/request.mjs&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Nov 2023 16:33:48 GMT</pubDate>
    <dc:creator>AndyGup</dc:creator>
    <dc:date>2023-11-15T16:33:48Z</dc:date>
    <item>
      <title>Axios Node.js Code Issue: Unexpected Behavior in API Request</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/axios-node-js-code-issue-unexpected-behavior-in/m-p/1349582#M82765</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I'm facing an issue with Axios in my Node.js application while making API requests. Below is a snippet of the code:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;const axios = require('axios');

const apiUrl = 'https://api.example.com/data';

axios.get(apiUrl)
    .then(response =&amp;gt; {
        console.log('Data:', response.data);
    })
    .catch(error =&amp;gt; {
        console.error('Error:', error.message);
    });&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm seeing unexpected behavior or issues even with the fairly simple Axios request. The response from the API is not what I expected. Additionally, I looked on a few websites&lt;/SPAN&gt;&lt;SPAN&gt;, but I couldn't locate anything. What possible code-related errors might be the root of this issue, and how can I fix them to guarantee that the API is responding correctly?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 14:15:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/axios-node-js-code-issue-unexpected-behavior-in/m-p/1349582#M82765</guid>
      <dc:creator>hectorsalamanca</dc:creator>
      <dc:date>2023-12-13T14:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Axios Node.js Code Issue: Unexpected Behavior in API Request</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/axios-node-js-code-issue-unexpected-behavior-in/m-p/1349761#M82770</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/648697"&gt;@hectorsalamanca&lt;/a&gt; you might try using esriRequest instead, it uses native fetch: &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#esriRequest&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Here's a working example that uses the pattern: &lt;A href="https://github.com/Esri/jsapi-resources/blob/main/esm-samples/jsapi-node/src/request.mjs" target="_blank"&gt;https://github.com/Esri/jsapi-resources/blob/main/esm-samples/jsapi-node/src/request.mjs&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 16:33:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/axios-node-js-code-issue-unexpected-behavior-in/m-p/1349761#M82770</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2023-11-15T16:33:48Z</dc:date>
    </item>
  </channel>
</rss>

