Answer the question
In order to leave comments, you need to log in
How to process json data in net?
Here comes the data
Connect
POST / HTTP/1.1
Content-Type: application/json; charset=utf-8
User-Agent: PostmanRuntime/7.26.3
Accept: */*
Postman-Token:
Host:
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 19
{
"test": 1
}
net.createServer( (sockComm) => {
sockComm.on('data', ( command ) => {
console.log(JSON.parse( command.toString() ) )
})
sockComm.on('end', ( command ) => {
console.log(command)
})
}).listen(port_command)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question