簡體   English   中英

HTTP GET服務器-錯誤的標題

[英]HTTP GET Server - Incorrect Header

我正在編碼HTTP服務器,但是當我創建標頭並發送它時。

它返回: The connection to 127.0.0.1 was interrupted.

我制作標頭的代碼是:

        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>";

換行符開始 -不應該。 基本上,更改此:

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

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM