I've an application that's uploading data to a server. Occasionally the server returns a 403 response from a call to HttpWebRequest.GetRequestStream(). The response contains more data than simply the response code, but I can't figure out how to access it. Is there a way to do this?
A:
I think what follows is just the text of the why the server sent back a 403:
John at CashCommons
2009-11-04 15:40:25
+1
A:
Have you tried calling HttpWebRequest.GetResponse() yet? The HttpWebResponse class provides access to that information.
Remy Lebeau - TeamB
2009-11-04 22:11:11
GetResponse seems to do a similar thing. It throws an Exception and so doesn't return a HttpWebResponse object.
alnorth29
2009-11-05 14:11:10
If a WebException is being thrown, then you can use the WebException.Response property to access the response info.
Remy Lebeau - TeamB
2009-11-06 00:30:24
Ah, fantastic, hadn't noticed that. Thanks!
alnorth29
2009-11-09 17:28:13