Question: Given the below snippet extracted from the request handler in the to - do list Server. Complete the code for the POST method to read

Given the below snippet extracted from the request handler in the to-do list Server. Complete the code for the POST method to read in data chunks as they arrive to the server
var list = U; //the todo list
const reqHandler =(reg, res)=>{
switch (reg. method){
case 'POST':
let item =";
req. setEncoding( 'utf-8');
//Fire data event when a data chunk arrives
reg.on([A],([B])=>{
item +=[CI;
});
req.on([D],()=>{
//push the item on to the list
[E]
console. log (list);
});
break; A= B= C= D= E=

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!