I used this piece of code to send some HTTP requests and receive data, and it worked fine. I recently updated apache and php to the latest versions, as well as node.
And the close event stopped firing. I also tried to โfinishโ and โfinishโ, none of this works.
I need to know when the answer is complete, so I can start processing the data, this usually happens in several pieces. Can you guys help?
var req = http.request(options, function(res) { res.on('data', function (chunk) { if(chunk != null && chunk != "") { dataString += chunk; c } }); }); req.on('close', function () {
Current versions: Apache 2.4, PHP 5.4 node 0.10.9
Perhaps there are some Apache configuration settings that prevent the connection from being closed?
PS I donโt think this is Apache, though .. I tried google.com with the same result .. quite strange ... Does anyone have an example of working code? (upload big data and know when it ended)
source share