<?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: @esri/arcgis-rest-request: How to adjust Fetch options? in ArcGIS REST JS Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-js-questions/esri-arcgis-rest-request-how-to-adjust-fetch/m-p/1245953#M20</link>
    <description>&lt;P&gt;I'm sorry&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/54252"&gt;@RYANCARL&lt;/a&gt;&amp;nbsp;I didn't see this message. I hope the saying "better later than never applies here", at least if this isn't helpful for you anymore maybe it would be for someone else in the future:&lt;/P&gt;&lt;P&gt;I think&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcgis-rest-js/api-reference/arcgis-rest-request/setDefaultRequestOptions" target="_self"&gt;&lt;SPAN&gt;setDefaultRequestOptions&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;have to be used like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;setDefaultRequestOptions({
  // only accepts iRequestOptions params 
  // authentication: ...,
  // credentials: ...
  // ...
  params: {
    // for additonal parameters use IParams
    agent: new https.Agent({rejectUnauthorized: false}),
  }
});&lt;/LI-CODE&gt;&lt;P&gt;I also recommend to use the &lt;A href="https://github.com/Esri/arcgis-rest-js/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc" target="_self"&gt;repo issues&lt;/A&gt; to contact the maintainers if you don't help a response soon enough in here.&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;BR /&gt;Raul&lt;/P&gt;</description>
    <pubDate>Fri, 06 Jan 2023 10:27:25 GMT</pubDate>
    <dc:creator>Raul_Jimenez</dc:creator>
    <dc:date>2023-01-06T10:27:25Z</dc:date>
    <item>
      <title>@esri/arcgis-rest-request: How to adjust Fetch options?</title>
      <link>https://community.esri.com/t5/arcgis-rest-js-questions/esri-arcgis-rest-request-how-to-adjust-fetch/m-p/1111828#M9</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I am looking to adjust the &lt;STRONG&gt;Fetch request option&lt;/STRONG&gt; when making a request with&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;@esri/arcgis-rest-request,&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;but unfortunately I cannot find any documentation related to this.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import fetch from "node-fetch";
import FormData from "isomorphic-form-data";
import arcgisRestRequest from "@esri/arcgis-rest-request";
arcgisRestRequest.setDefaultRequestOptions({ fetch, FormData });

arcgisRestRequest.request("https://www.arcgis.com/sharing/rest/info")
  .then(response =&amp;gt; console.log(response));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When using the&amp;nbsp;&lt;STRONG&gt;request&lt;/STRONG&gt; method I am getting errors regarding the certificate of the NodeJS server:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;FetchError: request to https://xxx/server/rest/self?token=xxx=json failed, reason: unable to get local issuer certificate&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;I would like to pass something like:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const fetchOptions = {
  ...
  agent:new https.Agent({rejectUnauthorized: false}),
  ...
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;to avoid the&amp;nbsp;certificate error.&lt;BR /&gt;&lt;BR /&gt;How can I accomplish this?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 19:27:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-js-questions/esri-arcgis-rest-request-how-to-adjust-fetch/m-p/1111828#M9</guid>
      <dc:creator>RYANCARL</dc:creator>
      <dc:date>2021-10-27T19:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: @esri/arcgis-rest-request: How to adjust Fetch options?</title>
      <link>https://community.esri.com/t5/arcgis-rest-js-questions/esri-arcgis-rest-request-how-to-adjust-fetch/m-p/1245953#M20</link>
      <description>&lt;P&gt;I'm sorry&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/54252"&gt;@RYANCARL&lt;/a&gt;&amp;nbsp;I didn't see this message. I hope the saying "better later than never applies here", at least if this isn't helpful for you anymore maybe it would be for someone else in the future:&lt;/P&gt;&lt;P&gt;I think&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcgis-rest-js/api-reference/arcgis-rest-request/setDefaultRequestOptions" target="_self"&gt;&lt;SPAN&gt;setDefaultRequestOptions&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;have to be used like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;setDefaultRequestOptions({
  // only accepts iRequestOptions params 
  // authentication: ...,
  // credentials: ...
  // ...
  params: {
    // for additonal parameters use IParams
    agent: new https.Agent({rejectUnauthorized: false}),
  }
});&lt;/LI-CODE&gt;&lt;P&gt;I also recommend to use the &lt;A href="https://github.com/Esri/arcgis-rest-js/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc" target="_self"&gt;repo issues&lt;/A&gt; to contact the maintainers if you don't help a response soon enough in here.&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;BR /&gt;Raul&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 10:27:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-js-questions/esri-arcgis-rest-request-how-to-adjust-fetch/m-p/1245953#M20</guid>
      <dc:creator>Raul_Jimenez</dc:creator>
      <dc:date>2023-01-06T10:27:25Z</dc:date>
    </item>
  </channel>
</rss>

