I want to download string from local server. To be precise from an ESP8266 wifi module. I'm posting a pure string there like"TEST". I'm trying
using (WebClient client = new WebClient())
{
string s = client.DownloadString("http://192.168.0.13");
MessageBox.Show(s);
}
but the Exception throws:
System.Net.WebException: The server committed a protocol violation. section=ResponseStatusLine
w System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
w System.Net.WebClient.DownloadString(Uri address)
w System.Net.WebClient.DownloadString(String address)
w logi.Logowanie.readEsp_Click(Object sender, EventArgs e) w d:\Projects Visual Studio\Projects\logi\logi\Logowanie.cs:line 81
I've also tried to build string in html so it looked like:
string pagestr="<html><head><title>TEST</title></head><body<h2>Testing</h2></body></html>";
but the error is the same.
Sorry, I'm a total newbie in this...