System.Net.WebException: The underlying connection was closed: The server committed an HTTP protocol

J

Jeff

I have the following code:

Dim data As New System.Collections.Specialized.NameValueCollection

data.Add("SWEExtSource", "XXXProductHttp")
data.Add("SWEExtCmd", "Execute")
data.Add("UserName", "uname")
data.Add("Password", "password")

Dim wc As New System.Net.WebClient
Dim responseArray As Byte()
Dim serverURL As String = "http://myserver/eai_enu/start.swe"
responseArray = wc.UploadValues(serverURL, "POST", data)
results = System.Text.Encoding.ASCII.GetString(responseArray)

It works great on most of our servers, but on one of them I get the
following error:

System.Net.WebException: The underlying connection was closed: The
server committed an HTTP protocol violation.

The ironic thing is that the data actually posts to the server, so it's
the return message that is causing the error. This is a windows
service.

Anyone run into this?

Thanks,
Jeff
 

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

Top