Questions tagged [node-fetch]
462 questions
0
votes
1 answer
How to process Array of JSON Stream Response in node.js server streaming http resquest
The stream response is form of
[{
"id":0,
"name":name0
}
,
{
"id":1,
"name":name1
}
]
if I use node-fetch stream feature to fetch, iterate the response.body, the chunk data is cut the object randomly. And I can't parse on it. I guess…

icelemon
- 827
- 2
- 11
- 23
0
votes
1 answer
How to download image (node-fetch), resize it (sharp) and upload to S3 without saving it locally using Node.js (Answered)
I am trying to migrate to S3, right now I serving the images trough URLs to other hostings, can I download it, change it's size while I am at it (to save on size and serve them faster), and upload it to S3 without saving a copy on my machine?

eliezra236
- 547
- 1
- 4
- 16
0
votes
0 answers
await function before returning response on nodejs
I need to await a nodejs function that runs a node-fetch requisition but it's presenting "Internal Server Error". This is a lambda function on aws and the url target is public and accessible. What I'm doing wrong?
My code:
const AWS =…

Sandro Benevides
- 581
- 2
- 14
0
votes
1 answer
Concat json to promise: How to get additional key value pair in json object from promise pending
I manually concat a json object to a promise. The code below on the first print, cosole.log(new_response) gets me this, which is what I want
Promise { , a: '123' }
However the second print, cosole.log(data_json_array) gets me the json…

Sun Tianyi
- 93
- 1
- 6
0
votes
1 answer
How do I properly route data through my Node API?
I have the following files:
My routes - where the orders_count route lives:
routes/index.js
const express = require('express');
const router = express.Router();
const transactionsController = require('../controllers/transactionsController');
const…

DougM
- 920
- 1
- 9
- 21
0
votes
0 answers
How to access request/response cookies with node-fetch like chrome devtools?
I am trying to understand why the chrome (and firefox) devtools network tab can see request/response cookies in an initial GET of a website, but node-fetch cannot.
For example, take stackoverflow.com. When I copy the initial GET with Google Chrome…

Ross Jacobs
- 2,962
- 1
- 17
- 27
0
votes
1 answer
How to set content-type in node-fetch
this is my code:
return fetch("https://www.motiondevelopment.top/api/v1.2/bots/" + botid + "/stats", {
method: "post",
headers: {
"Content-Type": "application/json",
"key": apikey,
},
body: {…

Sprocx
- 23
- 5
0
votes
0 answers
Discord get bot information from id
i want to get bot information like name, avatar ecc. by using id.
For fetch user information, i use this code:
fetch('https://discord.com/api/users/@me', {
headers: {
authorization: `Bearer ${accessToken}`
…

BlackdestinyXX
- 331
- 3
- 17
0
votes
1 answer
Fetch status on audio stream - HTTP Response
probably a simple question for some of you to answer.
I'm trying to check the status of an online audio stream then utilize that stream in some code (https://api.tmw.media/ggradio/stream & https://api.tmw.media/ggradio/stream/ogg). I know I will get…

Jonathan Stevens
- 57
- 1
- 15
0
votes
0 answers
cheerio can't wait for node-fetch
app.get('/god', (req, res) => {
let year = 2533;
let preyearlist = [];
let preyearsuperlist = [];
let yearlist = [];
let nextyear = new Date().getFullYear()+543;
let channel = [];
while(year <=…

RBP
- 27
- 1
- 4
0
votes
1 answer
How to improve async node fetch with a synchronous internet connection?
I have a fast synchronous fibre connection at home. The speed is great for streams and large packages. However multiple async node fetch are very slow due to the connection overhead. I never have more than 2 async fetch from my localhost. With the…

Dennis Bauszus
- 1,624
- 2
- 19
- 44
0
votes
2 answers
Session cookie from node-fetch is invalid?
I am writing a javascript program (for a github action) right now but ran into a problem.
I was trying to log into www.overleaf.com and access the page https://www.overleaf.com/project after generating a session cookie by sending a POST request to…

jmir
- 13
- 4
0
votes
1 answer
Intermittent download failures of json using node-fetch
Im trying to download a json response from an API and it fails like 9 out of 10 times.
The response is quite large - roughly 90mb. Downloading in postman, webbrowser works every time, but in node the response seems to be distorted and not a valid…
0
votes
1 answer
Sending Headers with a GET request to Third Party API
I am trying to build a small full-stack application, where my frontend code will only interact with my backend, and the backend will call Third Party API to fetch results and then do whatever it wants with it.The third party API I am using requires…

VIVEK JAIN
- 96
- 12
0
votes
1 answer
Foreach and push() with async await doesn't push the values
Here's my code:
app.get("/bots/:id", async (req, res)=>{
var bot = await Bots.findOne({id: req.params.id});
if(!bot) return await res.send("not there");
bot.desc = await marked(bot.desc);
var user = req.user;
bot.owner = [];
await…

Ren Hiyama
- 383
- 2
- 13