Questions tagged [node-fetch]

462 questions
2
votes
1 answer

What does the 'maximum redirect' error in fetch-api means?

I am trying to fetch some data from a website but got the following error: { FetchError: maximum redirect reached at: at ClientRequest. (C:\Users\Michal\Desktop\argentina\node_modules\node-fetch\lib\index.js:1498:15) at…
Efi Gordon
  • 406
  • 1
  • 6
  • 9
2
votes
1 answer

Problem with reason: connect ECONNREFUSED in Node.js

I'm a beginner in node.js. I would like to connect with API for training. I'm behind the company proxy. I have an api-key: http://numbersapi.com/2000/math?json and I want to connect via node-fetch, but I get an error in console: Error: {…
Vuzii
  • 75
  • 8
2
votes
1 answer

FetchError: request to https://discordapp.com/api/v7/gateway/bot failed, reason: read ECONNRESET

I'm working with a Discord bot using the node.js module discord.js. Recently an error appears on start up (when the bot attempts to login) when using the work wifi which I believe was configured in some way that caused it to break. (node:104)…
user7393973
  • 2,270
  • 1
  • 20
  • 58
2
votes
0 answers

returning a value from node-fetch

exports.img = function(){ fetch("http://aws.random.cat/meow") .then(res => res.json()) .then(json => console.log(json.file)); } I have been trying to return the "file" value from the json i fetched but I keep either producing "promise { }"…
2
votes
2 answers

node-fetch: why is `signal` recommended over `timeout`?

The node-fetch documentation suggests that using signal is recommended over timeout, but doesn't offer any hints as to why: {     // These properties are part of the Fetch Standard …
David Wolever
  • 148,955
  • 89
  • 346
  • 502
2
votes
0 answers

Node only downloads partial image for some urls

I'm having trouble while downloading some images using node-fetch. This only happens on windows (osx works fine), and with specific urls. At first, I thought it was related to node-fetch itself, but while stripping down my code to post an example to…
bastien girschig
  • 663
  • 6
  • 26
2
votes
1 answer

get javascript object from script in html

This is what I have, html: I want to get this part: { "id": "6yb32e53e03g4", "nickname":…
J. Kane
  • 67
  • 6
2
votes
2 answers

Connecting to Discogs REST API

I'm attempting to use the Discogs API to fetch some titles via Node.js and the node-fetch package. I've attached an example below. I suspect that I'm not setting up authorization right. I know that for some actions I need to do a full Oauth login…
zkwsk
  • 1,960
  • 4
  • 26
  • 34
2
votes
4 answers

How to deal with returned object on Error in a Promise-based business-level function in Node.js?

I need to create a business level function called "getLocationById" which retrieves some data from a remote server via REST API. This function is then called by a router to display the data on a web page. If the fetch call is successful, the json…
alextc
  • 3,206
  • 10
  • 63
  • 107
2
votes
1 answer

How to translate CURL -F @filename to nodejs

I have to translate a working curl request in nodejs javascript. I did succeed with previous similar queries that didn't implied file transfer. curl --compressed -u $username:$password https://analysiscenter.veracode.com/api/5.0/uploadfile.do -F…
2
votes
1 answer

Problems with resolving dependency node-fetch from github - fork still necessary?

While trying to install build dependencies in a docker environment (no git), we got follwing error: npm ERR! git clone --template=/home/node/.npm/_git-remotes/_templates --mirror git@github.com:archilogic-com/node-fetch.git…
meme
  • 83
  • 5
2
votes
1 answer

dealing with an array of objects with promises

I am trying to make a node express app where I fetch data from different url's making a call to node-fetch to pull the body of some pages and other information about certain url endpoints. I want to then render a html table to display this data…
petermas
  • 23
  • 1
  • 1
  • 3
1
vote
0 answers

Node.JS 18.16.1 -> Fetcherror: Unsafe Legacy Renegotiation

I am getting following error when trying to make an API call to the vendor server. The issue I am facing is my code works when using node version 16 and following error is encountered when using node version…
1
vote
1 answer

How to fix the ECONNREFUSED NodeJS( + NEST ) error when making fetch request in a dockerized node server?

I am trying to make a fetch request using a dockerized NodeJS( + nest framework ) (version 16.20.0) server. The docker image contains a strapi container running on http://localhost:1337/ and nodejs_api container running on http://localhost:4000/. I…
1
vote
1 answer

Accessing zabbix API with node-fetch

I am trying to access Zabbix API from a Node.js app with the following code: fetch( "http://localhost:8080/api_jsonrpc.php", { method: "POST", headers: { "Content-Type": "application/json", }, data:…
Grimalkin
  • 107
  • 12