Page view counter
HttpWebResponse.GetResponseStream() is null-http status code 500
Last post 06-28-2008 5:55 AM by vb7484. 2 replies.
Sort Posts:
06-19-2008 12:41 AM
HttpWebResponse.GetResponseStream() is null-http status code 500
When HttpWebResponse.StatusCode!=HttpStatusCode.OK then GetResponseStream() is null, but how I can get response in case of http status code is 500 or something like that? Server trying to say something to me,but I can't read.

Thanks.

XASD

Loading...
Joined on 10-28-2005
Posts 54
06-23-2008 4:46 AM
Marked as Answer
Re: HttpWebResponse.GetResponseStream() is null-http status code 500

Unfortunately due to browser stack limitation, currently there's no way to get the actual http status code... If you have the control over the server, you can customize the response, so if something wrong happens, it still returns 200, but with a message indicating something wrong happened...

shanaolanxing - I'll transfer to the Windows Azure team, and will have limited time to participate in the Silverlight forum. Apologize if I don't answer your questions in time.

Yi-Lun Luo - MSFT

Loading...
Joined on 10-29-2007
Posts 2,688
06-28-2008 5:55 AM
Re: HttpWebResponse.GetResponseStream() is null-http status code 500

You need to catch the WebException that is thrown by HttpWebRequest.GetResponse. This exception includes useful info about Status, and the actual WebResponse that you're after. Just read the MSDN page: http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx

vb7484

Loading...
Joined on 06-28-2008
Posts 1
Microsoft Communities