Questions tagged [node-fetch]
462 questions
0
votes
0 answers
Post web login form in Node
I'm using request to post a request to login.php with the parameters uid and pwd, and then using node-fetch to read a page that's behind the auth.
(async function () {
request.post(
'login.php',
{ form: {
uid:…

Mattias
- 285
- 2
- 18
0
votes
1 answer
How can I call a function only once all requests have finished?
I am currently generating a few requests using the npm package request like this:
for (var i = 0; i < array.length; i++) {
var options = {
url: '...',
headers: {
'...'
}
};
function callback(error,…

TheProgrammer
- 1,409
- 4
- 24
- 53
0
votes
2 answers
Skip waiting time using node-fetch
I use node-fetch and cheerio to craw data from a comic website. I just use a simple code to display the body html like below:
var fetch = require('node-fetch');
var cheerio = require('cheerio');
var url = 'http://readcomiconline.to';
function…

Nguyen Hoang
- 540
- 5
- 25
0
votes
1 answer
Retain image metadata using fetch
I'm using fetch to download images from a remote server and then upload to an AWS S3 store. The download, setting content-type and uploading are working fine but in the process I am losing the image meta-data (e.g. the copyright, date taken, camera…

Daz
- 71
- 2
- 5
0
votes
0 answers
How to use the Node’s fetch() in the same way as Request? (API rejects KEY)
In my application, I use the async/await logic for working with an API.
The problem is I can’t figure out why the check() function works with no hassle:
const KEY = 'my key';
const SECRET = 'my secret';
function getSign(form) {
return…

Honza Hejzl
- 874
- 8
- 23
0
votes
0 answers
nodejs fetch implementation using superflous "then"?
I just started using the library "node-fetch". In the documentation there a serveral examples on how to use the library:
fetch('https://api.github.com/users/github')
.then(function(res) {
return res.json();
}).then(function(json) {
…

Tobias Gassmann
- 11,399
- 15
- 58
- 92
0
votes
1 answer
ReactJS - Fetch Route with Query Parameters
I'm facing an issue with my ReactJS setup where I am trying to retrieve query parameters in my url to append to the URL route that is being called in my fetch function. Is there a package I should be using to be able to achieve this? cheerio a…

cphill
- 5,596
- 16
- 89
- 182
0
votes
1 answer
Paperclip not saving image because of wrong content type
I am having issues uploading an image from Node js app to a remote server.
The remote server app is Rails 5 and using paperclip to save the file.
When I upload the image through Postman , the image is saved successfully and everything works fine.…

sparks
- 471
- 1
- 6
- 19
0
votes
1 answer
Create a request waiting-list on NodeJs
I'd like to build a NodeJS server that responds to requests just one at the time.
Basically: by doing fetch('/request/ I want that untill the client received the data the other requests are queued. Is it possible?

andrealeone
- 15
- 2
0
votes
2 answers
incorrect behaviour of node-fetch while trying to get token from an api
I want to connect to an external api using some node-fetch code. My code first sends the login details & should receive a token from the api. Then this token is used for all the later communications.
Here is the code :
import fetch from…

Kapil Gupta
- 7,091
- 5
- 16
- 25
0
votes
1 answer
get call status in nodejs from grandstream phone
I am trying to fetch the call status of a grandstream phone by a nodejs script. But I've run in some trouble. The first request is going all fine, and returning that I am authenticated. The second request isn't going well, it says that I'm not…

Geert Boetzkes
- 19
- 4
0
votes
1 answer
Api - Page can't be found
I'm requesting some data from an API - in particular https://api.tvmaze.com/singlesearch/shows?q=Friends&embed=episodes usually, when I get an invalid request with APIs I get it in JSON format. So I can easily send that data back (to discord). But…
user7442152
-1
votes
1 answer
Can I substitute dependencies for a module (for example, replace node-fetch with the inbuilt fetch) using Vite?
I have a number of packages that depend on node-fetch:
$ npm ls node-fetch
myapp@1.0.0 /home/mike/Code/myapp@1.0.0
├─┬ @metaplex-foundation/js@0.18.1
│ ├─┬ @bundlr-network/client@0.8.9
│ │ └─┬ near-api-js@0.44.2
│ │ └── node-fetch@2.6.7 deduped
│…

mikemaccana
- 110,530
- 99
- 389
- 494
-1
votes
1 answer
Node-fetch not working like REST client, why?
Trying to use node-fetch and it comes back with an empty response: {"size": 0, "timeout": 0}. This is supposed to be an OAUTH2 Access Token (basically a JWT). What did I do wrong?
async function getAccessToken() {
if…

Woodsman
- 901
- 21
- 61
-1
votes
1 answer
Using proxy to make request results in bad request (400) error code
I'm using node-fetch and https-proxy-agent to make a request using a proxy, however, I get a 400 error code from the site I'm scraping only when I send the agent, without it, everything works fine.
import fetch from 'node-fetch';
import Proxy from…

FC5570
- 163
- 4
- 12