Questions tagged [node-fetch]

462 questions
1
vote
0 answers

How to get request object from response (node-fetch)?

I want to get request Object from response using node-fetch lib. For example my request failed: const ok = await response.ok console.log(ok) // ->false And I want to get request info from my response to repeat it. It will be good something like…
professrr
  • 95
  • 1
  • 1
  • 5
1
vote
2 answers

Fetch from JavaScript and node-fetch from node.js, what are the differences

I am recently learning how to code on Udemy, and I encountered a problem. when we fetch API we can fetch from the browser and we can also use node-fetch from node.js. I want to know what's the difference between them. Can we directly fetch API from…
Peter Li
  • 21
  • 1
  • 3
1
vote
0 answers

Write data to json file located tin a URL using nodejs

Is there a way in which I could write data to a url like https://xenialbase.web.app/file.json using axios or node-fetch in javscript and then display the value in that url this is the code I tried using axios but after refreshing the link I am not…
Adhvaith Prasad
  • 129
  • 1
  • 6
1
vote
1 answer

node-fetch to get id from html website but I am getting error 200 undefined

I just started learning Node.js. I am trying to return the body of the response by using node-fetch but I received an undefined output. I should get a '0' as response but I am getting '200 undefined' this is from the target website where I am trying…
Onur Keles
  • 11
  • 1
1
vote
2 answers

How to use fetch from node-fetch inside an express router get request

I'm using node-fetch to get external resources from github (user repos) inside an express router get request as follows. import fetch from 'node-fetch router.get('/github/:username', async (req, res) => { try { const uri =…
Umar Khan
  • 13
  • 1
  • 4
1
vote
1 answer

NodeJS Running multiple fetch requests inside multiple Node-Schedule jobs

My goal is to be able to run different functions in each of the multiple node schedule jobs, which will run at specific times of the day, and will call a specific function depending on the time of the day. I have the following code, for a minimum…
Alejandro Jurado
  • 137
  • 1
  • 3
  • 15
1
vote
2 answers

Node-fetch not providing all HTML from a page in body

I'm using cheerio and node-fetch to get all the product links on a specific URL. I get back an array of links, but the list is incomplete as the body is missing the HTML with the product…
ppedrazzi
  • 787
  • 2
  • 10
  • 23
1
vote
1 answer

Alternative solution to comparing a string with file data before node-fetch

I'm making a discord bot with a pokemon lookup command that calls poke-api to find information regarding the Pokemon. I have no specific errors being returned, I'm just looking for guidance on how to reformat a certain section, since I'm new to…
iLluZionZz
  • 25
  • 5
1
vote
1 answer

Why do Tenor GIFs result in a Discord poop image in embeds?

Code Introduction I was making a command where if you type p!shrug it sends a random shrug GIF from Tenor. I'm using Tenor API and node-fetch for my code. Problem The bot sends an embed as requested but the image in the embed is a Discord Poop…
Darshan B
  • 658
  • 1
  • 5
  • 19
1
vote
0 answers

Fetch media and serve it from express

The problem I'm having is that when I use Chrome, Firefox or any Android browser, images or videos displays correctly but on Safari (iOS, I don't tested it on Mac OS Safari) videos loading as a transmission. My code which works properly on the…
yulof
  • 11
  • 3
1
vote
0 answers

How to send from a Node.js server an Image combined with a random number to the client

So, I'm new to web development I'm just trying to get the basics down. Any ideas of even where I can find hints to a solutions to this issue would help a lot. When my client enters the url http://localhost:5000/creatAccountPage the server sends him…
Cavern head
  • 21
  • 1
  • 7
1
vote
1 answer

How to get raw file data from node-fetch calls?

Supposing I have an endpoint like https://someurl.com/myfile.mp4. I want to fetch the mp4 file and insert its raw data into a string in order to calculate the sha256 of the entire file content. How to do this using the node-fetch library? All the…
Fnr
  • 2,096
  • 7
  • 41
  • 76
1
vote
1 answer

HTTP 200 (OK) returned instead of 301 (Moved Permanently)

This URL returns a code 301 to wget and curl, but node-fetch is reporting 200: # wget https://www.h24info.ma/feed --2021-03-19 11:30:23-- https://www.h24info.ma/feed Resolving www.h24info.ma (www.h24info.ma)... 104.21.39.120, 172.67.145.67,…
yPhil
  • 8,049
  • 4
  • 57
  • 83
1
vote
0 answers

NodeJS Node-Fetch Sending multipart stops before sending file stream

I have a NodeJS/Express/Node-Fetch stack that attempts to receive a file via a multi-part upload from a browser and forward that request with little adjustments to a Java Spring Boot server. My routing snippet is below. I have verified that the file…
Woodsman
  • 901
  • 21
  • 61
1
vote
0 answers

Proxy multipart form data using NodeJS and node-fetch

How can I convert an incoming NodeJS/Express Request (req) object into something that can be sent over in a proxy request? My NodeJS/express service uses node-fetch to proxy requests to a separate server. The incoming curl request looks like this…
Woodsman
  • 901
  • 21
  • 61