473,396 Members | 1,767 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,396 software developers and data experts.

Timeout exception with HttpWebRequest.getResponse but not IE

I have the following URL:

http://patft.uspto.gov/netacgi/nph-P...er)+OR+provide)

Accessing it with the following code snippet (which works for other sites):
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
throws a WebException (timeout). Accessing the same URL with IE works fine.
I compared the request header sent by the code and the one sent by IE and
they are identical. The user agent has been set to "Mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50215)"

I even increased the request timeout to a massively huge value and it didn't
make any difference.

Nov 17 '05 #1
1 3406
Jason Manfield wrote:
I have the following url:

http://patft.uspto.gov/netacgi/nph-P...t2=HITOFF&u=/n
etahtml/search-adv.htm&r=2&p=1&f=G&l=50&d=ptxt&S1=((teeth+OR+memb er)+O
R+provide)&OS=+(teeth+OR+member)+OR+provide&RS=((t eeth+OR+member)+OR+p
rovide)

Accessing it with the following code snippet (which works for other
sites): HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
throws a WebException (timeout). Accessing the same URL with IE works
fine. I compared the request header sent by the code and the one
sent by IE and they are identical. The user agent has been set to
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR
1.1.4322; .NET CLR 2.0.50215)"

I even increased the request timeout to a massively huge value and it
didn't make any difference.


This weird server returns neither a Content-Length, nor Connection:
close, nor Transfer-Encoding: chunked. This is a (HTTP 1.1) protocol
violation, and is detected by the .NET Framework.
Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 17 '05 #2

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

Similar topics

0
by: Adrian Casey | last post by:
I have a python script which uses pexpect and I want to timeout (i.e. raise pexpect.TIMEOUT) if a long running command does not produce the output I am expecting. To simulate the 'long running...
1
by: Jeff B | last post by:
I'm trying to create a simple screen scraping application and I kept getting a System.Net.WebException thrown back with a message of "The operation has timed-out." At first I thought it was some...
5
by: japslam japslam via DotNetMonster.com | last post by:
Hi all, I have problem when I use HttpWebRequest and take long time to call to my service server. If at that time there are many request comes in semultaneous, I will get this exception ...
2
by: Steve Richter | last post by:
I have a page that uses simple HTTP GET to do an ISBN lookup via Amazon.com. The page works when I run it from //localhost. But I have moved it to my godaddy.com shared hoster site, and I get...
2
by: GlennLanier | last post by:
Hello, I've searched the forums and can't find an answer -- if it i there, kindly point me in that direction. I would like to simulate a browser POSTing a FORM and be able to pars the response....
0
by: Veerle | last post by:
Hi, On the website of the Belgian lottery, you can download an excel sheet with lottery results (the winning numbers) over the years and an excel sheet with financial results (the winnings) over...
1
by: MikeZ | last post by:
I post this question last week, no good answer, so I post again. Sorry about this. I use WebRequest.Create/WebRequest.GetResponse to handle HTTP request in a VS2003 project. I got HTTP violation...
1
by: Morgan Cheng | last post by:
When the function HttpWebRequest.GetResponse() is called, what happened? I mean, does this function return till all HTTP response is downloaded to local machine? or only HTTP header part retrived...
4
by: =?Utf-8?B?SmltIE93ZW4=?= | last post by:
Hi, I've run into a set of errors I don't understand coming back from HttpWebRequest.GetResponse, In one case, null is returned from the request without an Exception and in the other the request...
3
by: FreddyMack | last post by:
Two questions: 1) In Silverlight 4.0 Beta, I cannot find HttpWebRequest.GetResponse() ... any ideas where the functionality may be? I have found the Async form, but not the Sync form. 2) Within...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...
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...

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.