471,325 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

request.GetResponse()

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?

--
Thanks
Regards.
Josema
Dec 14 '05 #1
4 5063
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.

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

"Josema" <Je******@ocu.org> wrote in message
news:68**********************************@microsof t.com...
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?

--
Thanks
Regards.
Josema

Dec 14 '05 #2
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" wrote:
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.

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

"Josema" <Je******@ocu.org> wrote in message
news:68**********************************@microsof t.com...
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?

--
Thanks
Regards.
Josema


Dec 14 '05 #3
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" <Je******@ocu.org> wrote in message
news:67**********************************@microsof t.com...
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" wrote:
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.

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

"Josema" <Je******@ocu.org> wrote in message
news:68**********************************@microsof t.com...
> 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?
>
> --
> Thanks
> Regards.
> Josema


Dec 14 '05 #4
Vadym Stetsyak wrote:
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,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Dec 14 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.