Reputation: 31
I have read all the answers on this topic here. It just does not solve my problem.
Every time I try to connect to the following server I get this Exception:
System.Net.WebException: Der Server hat eine Protokollverletzung ausgeführt. Section=ResponseStatusLine bei System.Net.HttpWebRequest.GetResponse()
This is my code:
string Url = "http://hbci01.fiducia.de:3000";
string Message = "HBCI-Message";
var req = WebRequest.Create(Url) as HttpWebRequest;
byte[] data = Encoding.ASCII.GetBytes(Helper.EncodeTo64(Message));
req.Method = "POST";
req.Timeout = 10000;
req.ContentType = "application/octet-stream";
req.ContentLength = data.Length;
req.KeepAlive = false;
req.ServicePoint.Expect100Continue = true;
req.UserAgent = "User-Agent";
req.Headers.Add("Header", "Header");
using (Stream reqStream = req.GetRequestStream())
{
reqStream.Write(data, 0, data.Length);
reqStream.Flush();
}
And yes, the server is listening on port 3000.
Does anyone have a solution?
Upvotes: 0
Views: 1373
Reputation: 120380
Replace the remote server with one that actually speaks non-corrupted HTTP.
Upvotes: 1