473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 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 5134
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: warlord | last post by:
I have a windows client app that is trying to download a file from a web server but I always get the following error when I call the GetResponse method of the Request object. The remote server...
1
by: | last post by:
I have a strange behavior of a following code: HttpWebRequest request=(HttpWebRequest)WebRequest.Create(@"http://.../target.jsp"); request.ProtocolVersion=HttpVersion.Version11;...
8
by: Morgan Cheng | last post by:
I happens to surf to http://www.codeproject.com/cs/internet/Crawler.asp, which claims that WebRequest.GetResponse() will block other thread calling this function until WebResponse.Close() is...
2
by: namit101 | last post by:
When I create an HttpWebRequest, it seems to have the right uri to access the website (with the GET variables there too). But as soon as I run request.GetResponse() the URL changes such that it no...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.