Questions tagged [node-fetch]

462 questions
2
votes
1 answer

How to download .xlsx file from AWS MWS API json response?

I am using the Express JS server to execute AWS MWS API. As per MWS documentation, _GET_REMOTE_FULFILLMENT_ELIGIBILITY_ return excel file object. I created API in node js but I am not able to get proper excel. I got weird characters in the…
Rohit Vyas
  • 790
  • 6
  • 16
2
votes
1 answer

node-fetch GET with a parameter

I want to get a url with "username" paramater in it. How can i do it? Example: get url: api/find-username paramater: username: "exampleusername" Is it possible with node-fetch module?
Hasan Kayra
  • 101
  • 1
  • 6
2
votes
1 answer

How to convert Active Directory Token curl command to a node-fetch

CURL command that works successfully when I put my own Tenant ID, Client ID, and Client Secret in: # Replace {tenant} with your tenant! curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d…
Dshiz
  • 3,099
  • 3
  • 26
  • 53
2
votes
1 answer

Node-fetch JSON problems

I'm currently working on a calculator feature for my discord bot. I've made a command that fetches steam market item price, and then calculate it according to the formula: ([price] - [price * 0.15]) * amount of cases, where 0.15 is the market fee.…
Brunon
  • 31
  • 2
2
votes
2 answers

When does the async / await chaining stop?

I was testing node-fetch and when I was using async / await, a question came up : I have to make my function async if I use await in it BUT since my function is async I need to await it and make the parent function async. And so on... Context…
Lexe.Elf
  • 61
  • 2
  • 10
2
votes
0 answers

How to parse multiple set-cookies using node.js solution?

I am running into a problem where the api is returning multiple cookies and node-fetch is only returning a single set-cookie. Retrieve res.headers.get('set-cookie') // Only the first cookie Actual Response set-cookie: 1 set-cookie: 2 set-cookie:…
user2167582
  • 5,986
  • 13
  • 64
  • 121
2
votes
3 answers

node-fetch help - getting FetchError: invalid json response > body at reason: > Unexpected end of JSON input

I am new to node.js and APIs so I am hoping someone can help! I am trying to use node-fetch to get JSON data from the fantasy premier league API. I have successfully done this in the client, but from my node.js server file I keep getting the…
joecampbelluk
  • 71
  • 1
  • 2
  • 5
2
votes
1 answer

TypeScript generic fetch function, wrong type for BodyInit

I don't understand this error. It says toBody() returns a Blob type. but to me it should return a string which is accepted by BodyInit type BodyInit = Blob | BufferSource | FormData | URLSearchParams | ReadableStream | string; export…
Jonas Grønbek
  • 1,709
  • 2
  • 22
  • 49
2
votes
2 answers

node-fetch send post request with body as x-www-form-urlencoded

i want to send a post request using node-fetch with a body payload encoded in the x-www-form. I tried this code but unfortunately it doesnt work: paypalSignIn = function(){ var username = process.env.PAYPALID; var password =…
Silas
  • 161
  • 2
  • 10
2
votes
1 answer

Getting LinkedIn access token through http request on node.js server

I am following the Authorization Code Flow (3-legged OAuth) documentation and I am now at step 3 where I need to use the authorization code in order to recieve an access token from LinkedIn. In the project I am using node.js, typescript and the…
Shrimpis
  • 123
  • 2
  • 8
2
votes
1 answer

node js fetch data from body

Hi i have just started to learn node.js and javascript. And I'm trying to fetch data from a url using node-fetch and then trying to json parse the data but i keep getting a return undefined. I'm trying to get the data from the variable game from the…
user14150233
2
votes
1 answer

How can I send a cookie via node-fetch

I recently started to work with the roblox api, It's been going good so far but I can't login. I tried to set the cookie by doing apiCall.headers.set-cookie = cookie, But that doesn't seem to work. How can I solve this issue? Would I have to get…
TheGreenMilko
  • 31
  • 1
  • 4
2
votes
0 answers

how to increase tps (throughput) of my nodejs custom library which makes https request

Created a nodejs library which makes an https request with client certificates(.crt,.key files) to a different server to get the response. For making a request I used the "request" npm module. While benchmarking the library, I was making 2000…
2
votes
1 answer

How to view the headers that were sent, using node-fetch?

I'm trying to figure out how to access the headers that were sent by a node-fetch request. When i do this, for example: const response = await fetch('http://playground.localhost') The response object seems to contain only information about the…
i.brod
  • 3,993
  • 11
  • 38
  • 74
2
votes
0 answers

Graphql Node Fetch File upload

I am currently trying to implement Apollo Federated Servers. However the issue i am facing is that apollo federation does not pass down files to resolvers in federated services. So in the gateway i need to POST the file to my rest endpoint see…
tom Bannister
  • 149
  • 2
  • 12