Questions tagged [node-fetch]

462 questions
1
vote
0 answers

Using a Proxy with Fetch in Node.js

I have been trying to access data from the Brawl Stars API for a while now, trying many different things. When you make API keys you have to whitelist IPs. My code uses node-fetch. I have been successful when using my home internet and IP address. I…
CactusBoy
  • 13
  • 1
  • 6
1
vote
1 answer

Using node-fetch to embed DnD spells from api

I'm wanting to be able to embed specific DnD spells taken from the 5e Api using a Discord bot. I can log all of the spells to the console using node-fetch but completely unsure of the next step in grabbing user input, mapping it to the correct spell…
JHPrime
  • 45
  • 5
1
vote
1 answer

Domain with host:port not working with node-fetch

const response = await fetch(API_URL, { method: 'POST', body: JSON.stringify(body), headers: headers }) Here API_URL = ​https://139.59.39.54:53724/business/1.0/verify Getting error TypeError: Only absolute URLs are supported I though…
sujeet
  • 3,480
  • 3
  • 28
  • 60
1
vote
1 answer

Issue: cron routine launching several times after Meteor server start

I'm currently working on a Meteor app. Several cron routine are launched using the npm package node-schedule. My problem is that after the initial launch of the meteor server (using the command line 'meteor yarn start:dev'), the routine is executed…
1
vote
0 answers

Maximum redirect when fetching URL

I am trying to fetch this URL "https://forums.pubg.com/forum/7-game-discussion-feedback/page/2/" and I get this error: maximum redirect reached at:…
Laurent Dhont
  • 1,012
  • 1
  • 9
  • 22
1
vote
1 answer

403 access denied error with Node.js fetch on external API

I've deployed my Node.js Koa API app on Heroku. I'm making a call to a USAJOB.gov API and it works on my localhost. However, on Heroku I get this error: You don't have permission to access "http://data.usajobs.gov/$(SERVE_403)/api/search?" on this…
Uy Hoang
  • 191
  • 1
  • 3
  • 8
1
vote
1 answer

Proxy API request through Express return pending Promise instead of response

I am currently trying to work with the Atlassian Jira rest API. In order to not get a CORS error I go through the recommended route of not sending the request from the browser but proxy it through my express server. Now as I am doing this, all I…
Stefan Januschke
  • 322
  • 4
  • 20
1
vote
1 answer

How to use nested object/array notation in node-fetch headers?

I am trying to make a fetch() api call from typescript application based on below specification: Method: POST Request URL: https://cloud.memsource.com/web/api2/v1/projects/KmtNyVlz1skQd2aMVEipp7/jobs?token=AuthenticationToken (Header)…
Kay
  • 1,235
  • 2
  • 13
  • 27
1
vote
1 answer

My seemingly valid URLs parse locally but fail when deployed on heroku

This is my first question on stackoverflow, so please be gentle. I'm building a simple app using node.js that relies on API calls to an external geo-encoding service. My program runs locally, but fails when deployed to heroku. Here's the function…
patrickT
  • 11
  • 1
  • 3
1
vote
0 answers

Cannot fetch Steam API user profile data via node-fetch

Whenever I try to fetch the public Steam user profile data I get the following error: (I have replaced my API key and ID with XX since they are not the issue) Response { size: 0, timeout: 0, [Symbol(Body internals)]: { body: Gunzip…
1
vote
0 answers

How I can create a file using multiple .chunk files?

I have more .chunk files which I fetch using node-fetch and using these files I want to create another file by "gathering them together" somehow. I tried with this: var fileStream = await…
ILikeCats
  • 11
  • 2
1
vote
0 answers

node-fetch: [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

My usage is pretty basic: import fetch from 'node-fetch'; const res = await fetch(url, GenerateRequestOptions(token)); and the fetch call yields a warning: [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated As I'm not…
SagiLow
  • 5,721
  • 9
  • 60
  • 115
1
vote
1 answer

NodeJS - Send JSON object parameters with node-fetch

I'm trying to create a webhook via the GitHub API. The docs say that I need to provide a config parameter, which should be an object, but I'm not sure how I can send a JSON in the URL parameters. Here's what I've…
APixel Visuals
  • 1,508
  • 4
  • 20
  • 38
1
vote
1 answer

node-fetch in discord.js cannot read property

I have been following the REST API guide from Discord.js, but I keep getting errors that the first property of the returning json cannot be read. I know that the api address is correct. This is what the response looks like: And here is my…
Zoef
  • 393
  • 2
  • 6
  • 18
1
vote
0 answers

Can make post request to localhost using node-fetch, but unable to do so using Axios

I have tried making the same post request using node-fetch and axios. var fetch = require('node-fetch'); var axios = require('axios'); async function fetchTest(host, port, body) { const response = { successMessage: '', …
user1283776
  • 19,640
  • 49
  • 136
  • 276