-1

I installed the web-request NPM package and want to get console messages from the website I chose to get. The problem was I didn't know how to.

  var result = await WebRequest.get('http://discordapp.com/app');
  var result2 = result.get.statusMessage();
  console.log(result2.content)

This is my code, it returns a TypeError that it cannot read statusMessage of undefined. I'm not really familiar with this NPM package and I wasn't able and unsure of how and where to get the documentation.

I use this website to get my package. This NPM package works in Javascript but is coded in TypeScript. I'm unsure if this affects me.

https://www.npmjs.com/package/web-request

SomePerson
  • 1,171
  • 4
  • 16
  • 45

1 Answers1

-1

Try this code:

 var result = await WebRequest.get('http://discordapp.com/app');
 var result2 = result.statusMessage();
 console.log(result2.content)
Abhijeet
  • 4,069
  • 1
  • 22
  • 38
Yaroslav Gaponov
  • 1,997
  • 13
  • 12