Hey,
When I do a request, sometimes the server returns a error for some reasons.
Usually, I use response.StatusCode, but in my case I can not use it, on error
Any Idea how to handle the error code return by the server in the catch WebException block ?
When I do a request, sometimes the server returns a error for some reasons.
Code:
Try
Dim request As HttpWebRequest
......
......
Dim response As HttpWebResponse = request.GetResponse <= Error(WebException) When the server returns 400, 403, .... 500,...
Catch ex As WebException
'I have to handle the error code
'How can I got the status code Here ??
End TryAny Idea how to handle the error code return by the server in the catch WebException block ?