473,706 Members | 6,828 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

request.GetResp onse()

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.GetResp onse (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 5150
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.o rg> wrote in message
news:68******** *************** ***********@mic rosoft.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.GetResp onse (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.UserAge nt = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
Maxthon; .NET CLR 1.1.4322)";
request.Content Type = "text/html; charset=utf-8";
request.KeepAli ve=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.o rg> wrote in message
news:68******** *************** ***********@mic rosoft.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.GetResp onse (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.o rg> wrote in message
news:67******** *************** ***********@mic rosoft.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.UserAge nt = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
SV1;
Maxthon; .NET CLR 1.1.4322)";
request.Content Type = "text/html; charset=utf-8";
request.KeepAli ve=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.o rg> wrote in message
news:68******** *************** ***********@mic rosoft.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.GetResp onse (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.d e
Dec 14 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
515
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 returned an error: (404) Not Found. When I run it against a website on my local machine everything works perfectly, but not against the remote server. I'm sure it's a security or permissions problem of some sort, but I'm not sure where to start.
1
3032
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; request.Method="POST"; request.ContentType="text/plain"; request.KeepAlive = true; request.ContentLength=data.Length; try
8
13574
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 called. I did some experimentation. public static void Main(string args) { for (int idx=0; idx<10; ++idx)
2
6256
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 longer includes the GET variables and it uses that new uri for accessing the server. Anyone know what might be the problem? string url = "http://internal.company.com?var1=x&var2=y"; HttpWebRequest request =...
0
8778
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9150
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8986
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7899
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6613
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4444
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4707
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2087
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.