VOOZH about

URL: https://www.geeksforgeeks.org/node-js/node-js-http-clientrequest-setnodelay-method/

⇱ Node.js http.ClientRequest.setNoDelay() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Node.js http.ClientRequest.setNoDelay() Method

Last Updated : 6 May, 2021

The http.ClientRequest.setNoDelay() is an inbuilt application programming interface of class ClientRequest within HTTP module which is used to set the socket such as delaying of excessive requests while requests are being limited is not desired.

Syntax:

const request.setNoDelay([noDelay])

Parameters: This method takes the Boolean value as a parameter. 

Return Value: This method has nothing to return.

Example 1: Filename-index.js

Run the index.js file using the following command:


 

node index.js

Output:


 

no delay is set

Example 2: Filename-index.js


 

Run the index.js file using the following command:


 

node index.js

Output:


 

no delay is set

Reference: https://nodejs.org/dist/latest-v12.x/docs/api/http.html#http_request_setnodelay_nodelay


 

Comment

Explore