HTTP GET Server Incorrect Header

I am coding a HTTP Server, but when I create the header and send it.

It returns: The connection to 127.0.0.1 was interrupted.

My code to make the header is:

        string header = "\r\n";
        header += "HTTP/1.1 200 OK\r\n";
        header += "Content-Type: text/html\r\n";
        header += "\r\n";
        header += "<html><head><title>Test</title></head><body>Testing</body></html>";
Jon Skeet
people
quotationmark

You're starting with a line break - you shouldn't. Basically, change this:

string header = "\r\n";
header += "HTTP/1.1 200 OK\r\n";

to

string header = "HTTP/1.1 200 OK\r\n";

people

See more on this question at Stackoverflow