.NET
Microsoft Technologies based on the .NET software framework.
3,572 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
asp net version 2.0
asp.net forms with vb.net
Dim strData As String = String.Empty
Dim wr As HttpWebRequest = Nothing
Dim wrRes As HttpWebResponse = Nothing
wr = DirectCast(WebRequest.Create(URi), HttpWebRequest)
wr.Timeout = TimeOut 'Milliseconds default is 3 minutes 180,000
wr.Credentials = System.Net.CredentialCache.DefaultCredentials
wr.Method = WebRequestMethods.Http.Get
wr.KeepAlive = True
wr.Headers.Add(HttpRequestHeader.Cookie, CookieHeader)
wrRes = DirectCast(wr.GetResponse(), HttpWebResponse)
Using strReader As StreamReader = New StreamReader(wrRes.GetResponseStream())
strData = strReader.ReadToEnd
strReader.Close()
End Using
I want to add
wr.UserAgent = ??
wr.Header = ??
Or is it wr.UserAgent.add ??
To show to URL request is coming via browser address bar and not a api call..
Question
thx