What is the difference and connection between res.write () res.send (), res.end ()?

and in res.writeHead (200, {

)
  "Set-Cookie": "myCookie=test",
  "Content-Type": "text/plain"

});
Why can"t you use res.send () if you want to return content after setting cookie? What should I use? Also available for res.cookie ("myCookie","test",) or res.writeHead (200, {

)
  "Set-Cookie": "myCookie=test",
  "Content-Type": "text/plain"

}) Why does this way of setting cookie not take effect in the response header when the first request is made, and there is no cookie?? in the response header only when the second request is made?

May.28,2021

http.ServerResponse class
1. If you want to continue returning content after writeHead , you should call the write / end method.
2. cookie is set on the client after the first server response, so the second client request will carry cookie (personal understanding)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb5b7b-2578.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb5b7b-2578.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?