Because it’s an object, the way to assign value to its properties is using :
.
Change the =
to :
to fix the error.
var options = {
host: 'localhost',
port: 8080,
path: "https://stackoverflow.com/",
method: 'POST'
}
More Related Contents:
- module.exports vs exports in Node.js
- Mocha / Chai expect.to.throw not catching thrown errors
- Callback after all asynchronous forEach callbacks are completed
- Why does a while loop block the event loop?
- How can I share code between Node.js and the browser?
- Best way to call an asynchronous function within map?
- How can i export socket.io into other modules in nodejs?
- Rest with Express.js nested router
- What is NODE_ENV and how to use it in Express?
- Module not found: Error: Can’t resolve ‘crypto’
- Send a message with Discord.js
- Creating Rooms in Socket.io
- How do I upload a base64 encoded image (string) directly to a Google Cloud Storage bucket using Node.js?
- grunt (minimatch/glob) folder exclusion
- listen EADDRNOTAVAIL error in Node.js
- How many concurrent setTimeouts before performance issues?
- Eslint does not allow static class properties
- node.js – Code Protection?
- Environment detection: node.js or browser
- res.sendfile in Node Express with passing data along
- In the `import` syntax of ES6, how is a module evaluated exactly?
- Curly brackets (braces) in Node.js ‘require’ statement
- Checking if a message was sent from a DM not working
- Writing binary data using node.js fs.writeFile to create an image file
- How to use the ‘main’ parameter in package.json?
- Calling Express Route internally from inside NodeJS
- Firebase TypeError: Cannot read property ‘val’ of undefined
- Conflict: Multiple assets emit to the same filename
- puppeteer wait for page/DOM updates – respond to new items that are added after initial loading
- NodeJS – setTimeout(fn,0) vs setImmediate(fn)