Web Client Response Headers Test

image_pdfimage_print

using System;
using System.Collections.Specialized;
using System.Net;

public class ResponseHeadersTest
{
public static void Main(string[] argv)
{
WebClient wc = new WebClient();

byte[] response = wc.DownloadData(argv[0]);
WebHeaderCollection whc = wc.ResponseHeaders;
Console.WriteLine(“header count = {0}”, whc.Count);
for (int i = 0; i < whc.Count; i++) { Console.WriteLine(whc.GetKey(i) + " = " + whc.Get(i)); } } } [/csharp]

This entry was posted in C# Network. Bookmark the permalink.