.net如何测量仅下载httpPost主体所需的时间,不包括httpPost标头和上传数据

时间:2021-06-12 10:14:08

One HTTP POST request/response transaction consists of

一个HTTP POST请求/响应事务由

  1. Upload Request Ηeaders
  2. 上传请求¾eaders

  3. Upload Request Βody
  4. 上传请求Βody

  5. Download Response Headers
  6. 下载响应标题

  7. Download Response Body
  8. 下载响应机构

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?

我正在寻找.net来测量单独使用4号以上(响应体)所需的时间。是否有事件接收器或聪明地使用.net api(标记POST标题已完成下载),我可以用它来开始计算后续响应体?

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.

更高级别的.net网络机制为此建议的更好,即WebClient。但任何有效的.net编码解决方案也将被接受。

1 个解决方案

#1


This might be somewhere to start..

这可能是某个地方开始..

DownloadProgressChanged (when it fires)

DownloadProgressChanged(当它触发时)

and

DownloadStringCompleted (when finished)

DownloadStringCompleted(完成后)

#1


This might be somewhere to start..

这可能是某个地方开始..

DownloadProgressChanged (when it fires)

DownloadProgressChanged(当它触发时)

and

DownloadStringCompleted (when finished)

DownloadStringCompleted(完成后)