Timeout exception with HttpWebRequest.getResponse but not IE

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the following URL:

http://patft.uspto.gov/netacgi/nph-...+OR+provide&RS=((teeth+OR+member)+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.
 
Jason said:
I have the following url:

http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=/n
etahtml/search-adv.htm&r=2&p=1&f=G&l=50&d=ptxt&S1=((teeth+OR+member)+O
R+provide)&OS=+(teeth+OR+member)+OR+provide&RS=((teeth+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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top