Henrik,
Are there cookies perhaps on the browser that are being passed to the
server? Also, does the server do anything based on the user agent string
that is sent to the server? Do you have to set up a proxy for the browser
(which would indicate you have to set up a proxy for the WebRequest as
well)?
The server can do a number of things, based on a number of different
parameters other than just the URL string.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Henrik" <He****@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.com...
The http request is a string like "http://IP/cgi/command.cgi?blablabla"
and
as said it works fine in a browser...
When i add the POST method i just get this:
System.Net.WebException: The operation has timed-out.
/henrik
"John Timney (ASP.NET MVP)" wrote:
When you say it works from a browser - are you doing a post or a get
request. Try forcing a post request through and see if that works from
the
net code.
Also, I assume that this (HTTP/CGI-string) is a quoted address string as
its
not in your example.
--
Regards
John Timney
ASP.NET MVP
Microsoft Regional Director
"Henrik" <He****@discussions.microsoft.com> wrote in message
news:62**********************************@microsof t.com... > Hi,
>
> I am trying to read some industrial webservers using the HTTP/CGI
webequest > like this:
>
> wrs = (HttpWebRequest)WebRequest.Create(HTTP/CGI-string);
> mwst = (HttpWebResponse wrs.GetResponse();
> str = mwst.GetResponseStream();
>
> This usually works fine but on some servers i get:
> "System.Net.WebException: The underlying connection was closed: The
> server
> committed an HTTP protocol violation."
>
> The same request works fine in IE and basically i just want whatever
> comes
> from the server to parse it...
>
> So how can i get around this http protocol violation and stille get the
data > from the server ? - Is there some alternative (- and less sensitive)
> way
to > do a CGi request ?
>
> --
> Henrik Hansen