User1076264835 posted
Hai guys,
I create a windows application using vb.net and put the httpwebrequest in the timer which is have a function for checking a time.
For the first request its working fine but when it continue to the second request I got an error The remote server returned an error: (400) Bad Request.
I already close GetResponseStream, dataStream and reader. I also used keepAlive = False
The request server is using HTTP version 1.0.
Dim request As HttpWebRequest = CType(HttpWebRequest.Create(URLStr), HttpWebRequest)
Using response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
Dim dataStream As Stream = response.GetResponseStream()
Dim reader As New StreamReader(dataStream)
Dim MTstatus As String = reader.ReadToEnd()
If status = "100" Then
status = "Ok"
End If
reader.Close()
response.Close()
dataStream.Close()
End Using