Questions tagged [node-fetch]
462 questions
0
votes
1 answer
Preserving data in a fetch request in node js
Oilà,
I'm a beginner with nodejs and I am using it to create a telegram bot. This is my code:
const Geolocation = (req) => {
var address = "15 Freedom Way, Jersey City, NJ 07305, United States";
let msg = "";
let…

kekko4000
- 37
- 4
0
votes
0 answers
Serverless framework with GCP consistently throwing EHOSTUNREACH when trying to access google oath
A few days ago, everytime I tried to interact with GCP using serverless (deploy, log even remove), I get the following error:
Environment: linux, node 18.12.1, framework 3.25.1 (local) 3.25.1v (global), plugin 6.2.2, SDK 4.3.2
Docs: …

SNS
- 1
0
votes
0 answers
Deploy layer through the cdk, "Cannot find module", but works when upload through aws console
When I upload lambda layer through console, the module is found when the lambda runs, but when I deploy the same layer through the cdk, it's not found.
lambda > Runtime.NODEJS_16_X
layer > node-fetch@2.6.7
Through the cdk:
{
…

Seb
- 133
- 1
- 12
0
votes
0 answers
mock node-fetch doesn't take the mocked value
Really new to frontend and Typescript unit test
What I am trying to do is mocking a fetch result
Here is my test
import { renderWithAllProviders } from '../../testUtil/helpers';
import IsItDownBanner from '../IsItDownBanner';
import fetch from…

Di Chu
- 23
- 1
- 6
0
votes
0 answers
Data is not defined error when fetching and parsing json using nodejs
const fetch = require('node-fetch');
const url = 'https://gist.githubusercontent.com/gcollazo/884a489a50aec7b53765405f40c6fbd1/raw/49d1568c34090587ac82e80612a9c350108b62c5/sample.json';
fetch(url)
.then(res => res.json())
.then(data => {
…

aste123
- 1,223
- 4
- 20
- 40
0
votes
0 answers
Unable to send a file via an HTTP POST request because the file extension is incorrect for a Buffer retrieved from AWS S3
I am in a Node.JS application. (Node version 14 if that matters)
Also I am using node-fetch (v2) to send my request.
I am trying to send a Send Fax Request to Documo. The documentation can be found here:…

hikarunoryoma
- 63
- 4
0
votes
0 answers
npm override not fixing vulnerability
This is my vulnerability report :
High node-fetch is vulnerable to Exposure of Sensitive
Information to an Unauthorized Actor
Package node-fetch
Patched in >=2.6.7
Dependency of react-table-drag-select
Path …

Sai Krishna
- 1
- 2
0
votes
0 answers
org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType using SOAP in NODEJS
I'm trying to run an XML post using node-fetch but I get this error:
org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType
Here is the body I send:
…

Mounaim
- 61
- 1
- 7
0
votes
1 answer
How to send a message to a Discord webhook in node.js?
I have tried the code posted in this answer (with some modification), but it tells me that fetch is not a function.
const fetch = import("node-fetch");
fetch(process.env.WEBHOOK, {
'method': 'POST',
'body': { 'username': json.username,…

vlone
- 33
- 7
0
votes
2 answers
PayPal-Mock-Response not working (nodejs, paypal negative testing)
I'm working on the code to cover negative scenarios like card declined and similar.
According to the documentation the only way to do it for Orders is to use the header PayPal-Mock-Response…

Igor.K
- 244
- 3
- 10
0
votes
1 answer
Getting TypeError: Only absolute URLs are supported in webdriverIO javascript with node-fetch
how can we append baseURL to relatives URLS as I am not able to convert it to string also .
please guide me on below solution:
const links = await $$('a');
console.log("count of the links are",testURLS.length);
const urls= await…
0
votes
1 answer
Using web scraping to recive all Twitter followers
I want to create giveaways which require the participants to follow the twitter account of the giveaway creator.
My first idea was to use the Twitter API (endpoint: "/2/users/:id/followers"). This works fine for me however I always run into rating…

David Peters
- 1
- 1
0
votes
0 answers
How to parse gunzip response body data coming from Twitter's /oauth2/token route in NodeJs using node-fetch?
I am trying to get access_token from Twitter for every user that authenticates through Twitter to my app. I've got code from Twitter but I have to send POST request to https://twitter.com/i/oauth2/token to get access_token. I am using node-fetch…
0
votes
1 answer
cannot get the json body of the request
Trying to get the body of the body using fetch and with the authentication of adobe. I always get this 200 response (means okay) but I cannot the actual response of body like in postman.
[Symbol(Response internals)]: {
url: url_of_adobe,
…

Jian Ruiz Mangampo
- 189
- 1
- 7
0
votes
0 answers
Data fecthing in MySQL vith Node js
I was used to python and migrated to nodejs in backend development
The extensions node-fetch and mysql are pretty similar in Docs I've been reading
I am so trying to store in a variable the rows I select from MySQL and from many different tries it…