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

P

pmclinn

I keep getting the following error:
The underlying connection was closed: The server committed an HTTP
protocol violation.

I have tried putting the

<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing="true" />
</settings>
</system.net>
</configuration>

file in the app directory to no avail....

This is the code I'm posting.... Any ideas?


Dim web As New System.Net.WebClient
web.Headers.Add("Content-Type",
"application/x-www-form-urlencoded")
Dim d As Byte() =
System.Text.Encoding.ASCII.GetBytes("pwd=C6K6J")
Dim res As Byte() =
web.UploadData("http://my_ip_here/product.htm", "POST", d)
MsgBox(System.Text.Encoding.ASCII.GetString(res))
 
P

pmclinn

Turns out the page has no headers. I'm still finding it impossible to
access this data via .net.
 

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