Consider this code:
Dim strUrl As String = "http://www.txtguru.in/imobile/api.php?username=username&password=password&source=senderid&dmobile=123456789012&message=message"
Dim request As WebRequest = HttpWebRequest.Create(strUrl)
Dim response As HttpWebResponse = DirectCast(request.EndGetResponse(), HttpWebResponse)
Dim s As Stream = DirectCast(response.GetResponseStream(), Stream)
Dim readStream As New StreamReader(s)
Dim dataString As String = readStream.ReadToEnd()
response.Close()
s.Close()
readStream.Close()
I get an error on request.EndGetResponse() and the error is:
Argument not specified for parameter ‘asyncResult’ of ‘Public Overridable Function EndGetResponse(asyncResult As System.IAsyncResult) As System.Net.WebResponse’.
How can I fix it?
Try changing –
to