Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why does http use CRLF as line delimiter?

As I know, use LF as line delimiter is quite popular, but I'm wondering why many text protocol like HTTP, FTP use CRLF as its line delimiter?

I don't think these protocols are invented for old typewriters, so is there any historic reason for this? I tried to search it over google and stackoverflow and wikipedia but do not get any reasonable information.

Thanks

like image 948
otakustay Avatar asked Jun 23 '13 16:06

otakustay


1 Answers

CR-LF as newline is the Internet standard, which long predates HTTP; I believe it was originally specified as part of TELNET in RFC 158 in 1971. The RFC Editor has a page explaining some of the history. This is the convention used by other Internet protocols such as FTP and SMTP, so it only makes sense for HTTP to be consistent with them.

like image 151
Simon Kissane Avatar answered Oct 23 '22 02:10

Simon Kissane