Web Request and Response: type and content type, length
Imports System.IO
Imports System.Net
Imports System.Text
public class MainClass
Shared Sub Main()
Dim uri As New Uri("http://www.java2s.com/index.htm")
Dim request As WebRequest = WebRequest.Create(uri)
Dim response As WebResponse = request.GetResponse()
Console.WriteLine("Request type: " & request.GetType().ToString() )
Console.WriteLine("Response type: " & response.GetType().ToString() )
Console.WriteLine("Content length: " & response.ContentLength & " bytes" )
Console.WriteLine("Content type: " & response.ContentType )
End Sub
End Class
Related examples in the same category