Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

183
Visualizações
NodeJS: @esri/arcgis-rest-request - How to adjust Fetch options?

I am looking to adjust the Fetch request option when making a request with @esri/arcgis-rest-request, but unfortunately I cannot find any documentation related to this.

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 => console.log(response));

When using the request method I am getting errors regarding the certificate of the NodeJS server:

FetchError: request to https://xxx/server/rest/self?token=xxx=json failed, reason: unable to get local issuer certificate

I would like to pass something like:

const fetchOptions = {
  ...
  agent:new https.Agent({rejectUnauthorized: false}),
  ...
};

to avoid the certificate error.

How can I accomplish this?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Looking at their code it looks like you should be able to just do

arcgisRestRequest.request(
  "https://www.arcgis.com/sharing/rest/info",
  {
    agent:new https.Agent({rejectUnauthorized: false})
  }
)
  .then(response => console.log(response));
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda