Hello. From what I understand, if client side javascript code uses the XMLHttpRequest to make a POST request, it waits for a response and when it completes it changes its readystate to ReadyState.Complete and invokes the callback function.
My question is: How does it determine that the response is complete? Does it return the contents of the first TCP packet it gets? Or does the server close the tcp connection hence completing the transaction? Or is there something special in the TCP packet contents that tells the XMLHttpRequest object that the response is complete?