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 4 5147
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
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
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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.
|
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
|
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)
|
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 =...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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...
|
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...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |