Answers for "get status code from webresponse visual basic CType(ex.Response, HttpWebResponse).StatusCode"

0

get status code from webresponse visual basic CType(ex.Response, HttpWebResponse).StatusCode

' Creates an HttpWebRequest with the specified URL.
Dim myHttpWebRequest As HttpWebRequest = CType(WebRequest.Create(url), HttpWebRequest)
' Sends the request and waits for a response.
Dim myHttpWebResponse As HttpWebResponse = CType(myHttpWebRequest.GetResponse(), HttpWebResponse)
If myHttpWebResponse.StatusCode = HttpStatusCode.OK Then
	Console.WriteLine(ControlChars.Lf + ControlChars.NewLine + "Response Status Code is OK and StatusDescription is: {0}", myHttpWebResponse.StatusDescription)
End If
Posted by: Guest on January-19-2021

Code answers related to "get status code from webresponse visual basic CType(ex.Response, HttpWebResponse).StatusCode"

Code answers related to "BASIC"

Browse Popular Code Answers by Language