The request.writableEnded (Added in v12.9.0) property is an inbuilt property of the ‘http’ module which returns true after request.end() has been called. This property does not indicate whether the data has been flushed, for this use request.writableFinished instead.
In order to get a response and a proper result, we need to import ‘http’ module.
const http = require('http');
Parameters: This property does not accept any parameters.
Return Value <Boolean>: It returns true after request.end() has been called.
The below examples illustrate the use of request.writableEnded property in Node.js.
Example: Filename: index.js
Run index.js file using the following command:
Status: 301 Moved Permanently
IP address of geeksforgeeks is 192.168.43.207.
Its port is 64596