TimeOut exception with HttpWebRequest.getResponse but not with IE
-
I have the following URL: http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=/netahtml/search-adv.htm&r=2&p=1&f=G&l=50&d=ptxt&S1=((teeth+OR+member)+OR+provide)&OS=+(teeth+OR+member)+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.
-
I have the following URL: http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=/netahtml/search-adv.htm&r=2&p=1&f=G&l=50&d=ptxt&S1=((teeth+OR+member)+OR+provide)&OS=+(teeth+OR+member)+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.
-
There is something wrong with the headers. I was getting this error: "The underlying connection was closed: The server committed an HTTP protocol violation." put this in your config file and it should resolve the issue.
Put what? It looks like you forgot to check the box below the message window that says "Do not treat <<s as HTML tags". RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Put what? It looks like you forgot to check the box below the message window that says "Do not treat <<s as HTML tags". RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
You might want to reply to the original poster with this, not me. He'll get a notification e-mail that says you replied to him that way. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome