Wednesday 31 July 2019

Help me understand the behaviour.

​CodeIf I run this block of code and send a post request including a file with request from any http client, I see 'Got a chunk' couple of times and at the end 'Got all data' in console. I expected it like this. I was happy!Then I notice, if I try to upload a large file I don't see anything in the console until the whole file is uploaded to server. Why do I think like that? Well, when I hit the send button in http client, it takes a lot of time to complete the request. When the request gets completed I see all the logs in my console.What I expected: I expected that file will be send in a chunk so I will start seeing logs almost immediately after sending the request because server will receive a small chunk and trigger the 'data' event.What am I missing here? What do I have to do to achieve the expected behaviour?​Thanks in advance.

Submitted July 31, 2019 at 02:46PM by mrdijkstra

No comments:

Post a Comment