Node.js http.ClientRequest.writableFinished API Last Updated : 08 Apr, 2021 Comments Improve Suggest changes Like Article Like Report The http.ClientRequest.writableFinished is an inbuilt application programming interface of class ClientRequest within http module which is used to check if all the data has been flushed or not. Syntax: const request.writableEnded Parameters: This API does not accept any argument as parameter. Return Value : This method returns true if and only if all the data has been flushed. Example 1: index.js // NodeJS program to demonstrate the // request.writableFinished APi // Importing http module const http = require('http'); // Create an HTTP server const server = http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('okay'); }); // Now that server is running server.listen(3000, '127.0.0.1', () => { // make a request const options = { port: 3000, host: '127.0.0.1', headers: { 'Connection': 'Upgrade', 'Upgrade': 'websocket' } }; // getting client request const req = http.request(options); // checking if the all data has been flushed // by using writableFinished api if(req.writableFinished) console.log('all data has been flushed') else console.log('all data has not been flushed') process.exit(0) }); Output: Comment More infoAdvertise with us Next Article Node.js http.ClientRequest.writableFinished API R rohitprasad3 Follow Improve Article Tags : Web Technologies Node.js NodeJS-API Similar Reads Node.js http.ClientRequest.writableEnded API The http.ClientRequest.writableEnded is an inbuilt application programming interface of class ClientRequest within http module which is used to check if the request.end() has been called or not. Syntax: const request.writableEnded Parameters: This API does not accept any argument as parameter. Retur 1 min read Node.js http.ClientRequest.end() API The http.ClientRequest.end() is  an inbuilt application programming interface of class ClientRequest within http module which is used to finish sending the request. If any parts of the body are unsent. Syntax: const request.end([data[, encoding]][, callback]) Parameters: This method takes the data a 2 min read Node.js http.ClientRequest.method API The http.ClientRequest.method is an inbuilt application programming interface of class ClientRequest within http module which is used to get the object of client request method. Syntax: const request.method Parameters: This API does not accept any argument as parameter. Return Value : This method re 1 min read Node.js http.ClientRequest.aborted Property The http.ClientRequest.aborted is an inbuilt application programming interface of class Client Request within http module which is used to check if the client request has been aborted or not. Syntax: request.aborted Parameters: It does not accept any argument as a parameter. Return Value: It does no 2 min read Node.js http.ClientRequest.setHeader() Method The http.ClientRequest.setHeader() is an inbuilt application programming interface of class ClientRequest within the HTTP module which is used to set the object of the header. Syntax: const request.setHeader(name, value)Parameters: This method takes the name and value of the particular header as a p 2 min read Like