Why does HttpWebRequest throw an exception instead returning HttpStatusCode.NotFound?

后端 未结 2 680
青春惊慌失措
青春惊慌失措 2020-12-09 14:58

I\'m trying to verify the existence of a Url using HttpWebRequest. I found a few examples that do basically this:

HttpWebRequest request = (HttpWebRequest)Ht         


        
2条回答
  •  孤街浪徒
    2020-12-09 15:24

    Why not? They're both valid design options, and HttpWebRequest was just designed to work this way.

提交回复
热议问题