Fetch and post text in NodeJS

0 votes

I'm having problems getting text from an API that just provides a string of text ((here)) and putting it in a response. It comes out as [object Response] when I post it, and the console.log doesn't show the content I want.

I'm using the following code:

fetch('http://taskinoz.com/gdq/api').then(
    function(response) {
      console.log(response);
      throttledSendMessage(channel, response);
      return response;
    })
  .catch(function(error) {
    throttledSendMessage(channel, "An error has occured");
  })
6 days ago in Node-js by Vaani
• 7,020 points
8 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Node-js

0 votes
1 answer
0 votes
1 answer

How to split and modify a string in NodeJS?

Hello @kartik, Use split and map function: var str = "123, 124, 234,252"; var ...READ MORE

answered Oct 16, 2020 in Node-js by Niroj
• 82,720 points
362 views
0 votes
0 answers

How can I completely uninstall nodejs, npm and node in Ubuntu

I installed it using: sudo apt-get install ...READ MORE

May 15 in Node-js by Kichu
• 19,040 points
151 views
0 votes
1 answer
0 votes
1 answer

Installing angularjs with NPM and NODEJS brings an error in ubuntu 16.04

Rename your angular folder to angular-test or ...READ MORE

answered May 30 in Node-js by Vaani
• 7,020 points
13 views
0 votes
1 answer

Making POST request to discord server in nodejs

You'll need to solve the captchas; I ...READ MORE

answered May 30 in Node-js by Vaani
• 7,020 points
15 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
963 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP