request.GetResponse()

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi to all,

I have a program that list broken links into a web site...

The program works in the majority of the times, but in some urls, i dont
know why, but the request.GetResponse (all the html of the page) that i get
using the program
is different than if i use the internet explorer...

Do you know a possible cause?
 
On of the reasons may be that server detects ( with the help of headers )
who is requesting the page and renders html appropriately.
inernet explorer sets User-Agent header, that identifies browser type. You
can try to dupclicate headers that IE sets.

Use some sniffer application to detect what HTTP headers has IE request, and
then set the same headers in your application.
 
Hi Vadim, first of all thanks for your fast response...

I download a utility to know which headers are used by Internet explorer...
Then i modified my application, but without success... (like this:

request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
Maxthon; .NET CLR 1.1.4322)";
request.ContentType = "text/html; charset=utf-8";
request.KeepAlive=true;

Do you know any link to a page with some piece of code about the headers of
the Internet Explorer....
--
Thanks
Regards.
Josema


Vadym Stetsyak said:
On of the reasons may be that server detects ( with the help of headers )
who is requesting the page and renders html appropriately.
inernet explorer sets User-Agent header, that identifies browser type. You
can try to dupclicate headers that IE sets.

Use some sniffer application to detect what HTTP headers has IE request, and
then set the same headers in your application.
 
Sniffer should tell you about the headers...

Also you can write your own asp.net application and test on it. From within
that application you can get headers of the request you send.

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com

Josema said:
Hi Vadim, first of all thanks for your fast response...

I download a utility to know which headers are used by Internet
explorer...
Then i modified my application, but without success... (like this:

request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1;
Maxthon; .NET CLR 1.1.4322)";
request.ContentType = "text/html; charset=utf-8";
request.KeepAlive=true;

Do you know any link to a page with some piece of code about the headers
of
the Internet Explorer....
 
Vadym said:
Sniffer should tell you about the headers...

Also you can write your own asp.net application and test on it. From
within that application you can get headers of the request you send.

Don't forget client-side scripting, which may also affect the resulting
page depending on whether the client actually executes scripts (like
IE) or not (like a pure HTTP client based on HttpWebRequest).

Cheers,
 
Back
Top