为什么HTTP协议以纯文本的方式设计的? [英] Why HTTP protocol is designed in plain text way?

查看:251
本文介绍了为什么HTTP协议以纯文本的方式设计的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天,我有我对HTTP的同事们的讨论。这是问为什么HTTP的设计以纯文本的方式。当然,它可以以二进制方式一样TCP协议进行设计,使用标志来重新presents不同种类的方法(POST,GET)和变量(HTTP头)的。那么,为什么HTTP以这样的方式设计的?是否有任何技术或历史的原因?

Yesterday, I have a discussion with my colleagues about HTTP. It is asked why HTTP is designed in plain text way. Surely, it can be designed in binary way just like TCP protocol, using flags to represents different kinds of method(POST, GET) and variables (HTTP headers). So, why HTTP is designed in such way? Is there any technical or historical reasons?

推荐答案

一个的理由的这是技术上和历史是文本的协议几乎都是美元的Unix世界pferred p $。

A reason that's both technical and historical is that text protocols are almost always preferred in the Unix world.

那么,这是不是一个真正的原因,但一个的模式的。这样做的理由是,文本的协议可以让你的的东西是由刚刚倾倒的经历一切顺利在网络上。因为你需要的TCP / IP,你并不需要一个专门的分析仪。这使得更容易调试和更易于维护。

Well, this is not really a reason but a pattern. The rationale behind this is that text protocols allows you to see what's going on on the network by just dumping everything that goes through. You don't need a specialized analyzer as you need for TCP/IP. This makes it easier to debug and easier to maintain.

不仅HTTP,但很多协议都基于文本(例如,FTP,POP3,SMTP,IMAP)。

Not only HTTP, but many protocols are text based (e.g., FTP, POP3, SMTP, IMAP).

您可能想看一看的 Unix编程艺术的对本Unix的东西更详细的解释。

You might want to take a look at The Art of Unix Programming for a much more detailed explanation of this Unix thing.

这篇关于为什么HTTP协议以纯文本的方式设计的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆