views:

114

answers:

1

One HTTP POST request/response transaction consists of

  1. Upload Request Ηeaders
  2. Upload Request Βody
  3. Download Response Headers
  4. Download Response Body

I'm looking in .net to measure the time it takes for no 4 above (response body) alone.
Is there an event sink or clever use of .net api (marking that the POST headers have finished downloading) that I can use to start timing the subsequent response body?

The higher level .net network mechanism suggested for this the better would be i.e. WebClient. But any effective .net coding solution would be accepted as well.

A: 

This might be somewhere to start..

DownloadProgressChanged (when it fires)

and

DownloadStringCompleted (when finished)

Paul
Breakpointing in DownloadProgressChanged shows that it fires unreliably either too early before the headers have downloaded (e.TotalBytesToReceive == 0) or too late (e.BytesReceived > 0).