.NET HttpWebRequest Speed versus Browser

前端 未结 9 1102
深忆病人
深忆病人 2020-12-29 13:01

I have a question regarding the performance of the .Net HttpWebRequest client (or WebClient, gives similar results).

If I use HttpWebRequest to request an html page

9条回答
  •  借酒劲吻你
    2020-12-29 13:46

    I'd jack Fiddler in the middle, run the browser request and the .NET request one after the other and make sure you're really getting what you think. It's possible there's redirection or something else hinky going on (maybe browser is pre-appending the '/' while .NET waits for the redir, etc) that isn't immediately visible. I've built huge apps on the .NET HTTP client with nothing like what you describe- something else must be going on.

    What happens if you stick '/' on the end of the URL?

提交回复
热议问题