![]() Res.on('error', err => console.log(err)) ![]() Here's a working version that also parses the JSON: import from 'https' Ĭonsole.log(res.statusCode, res.statusMessage) ) to know when all of the response has arrived. I would agree that the wording in the doc does not make this clear, but there are multiple coding examples in the doc that show using res.on('end'. The close event occurs on the req object, not the res object.Ĭode example here in the doc. You need to be listening to the end event, not the close event.
0 Comments
Leave a Reply. |