Hasani (remove nospam from address) wrote:
> Does anyone else agree with me that the WebRequest object SHOULD NOT throw
> an exception when the web server returns a status code of 500? I mean, 500
[quoted text clipped - 4 lines]
> .net framework, and I think highly of everyone involed in its creation and
> ongoing progress but I find this to be a blatanly horrible design choice.
I don't agree. HttpWebRequest throws excections for all status codes
but 200 and 3xx. This is documented. You can still obtain the
Response object from the WebException.Response property.
Checking for error codes is out.
bye
Rob
Hasani \(remove nospam from address\) - 30 Sep 2004 20:16 GMT
> I don't agree. HttpWebRequest throws excections for all status codes
> but 200 and 3xx. This is documented. You can still obtain the
> Response object from the WebException.Response property.
I can't find documentation that explicitly states that it throws on 200 and
3xx, but you are right about the properties of the WebException and this
will be good enough for my needs. Thx for helping me out.
> Hasani (remove nospam from address) wrote:
>
[quoted text clipped - 16 lines]
> bye
> Rob
Robert Jordan - 30 Sep 2004 20:28 GMT
Hasani (remove nospam from address) wrote:
>>I don't agree. HttpWebRequest throws excections for all status codes
>>but 200 and 3xx. This is documented. You can still obtain the
[quoted text clipped - 3 lines]
> 3xx, but you are right about the properties of the WebException and this
> will be good enough for my needs. Thx for helping me out.
From "about HttpWebRequest"
"The HttpWebRequest class throws a WebException when errors occur while
accessing an Internet resource. The WebException.Status property is one
of the WebExceptionStatus values that indicates the source of the error.
When WebException.Status is WebExceptionStatus.ProtocolError, the
Response property contains the HttpWebResponse received from the
Internet resource."
bye
Rob
Hasani \(remove nospam from address\) - 30 Sep 2004 20:18 GMT
I also want to take back 'I find blatanly horrible design choice' statement.
=]
> Hasani (remove nospam from address) wrote:
>
[quoted text clipped - 16 lines]
> bye
> Rob