Tag Archive

总结:HTTP协议规范(RFC2616)中关于BNF的章节对照解释(转)

Published on 2010年10月11日 By pangyt

靳雄飞 2009-11-03 22:46 巴克斯范式(BNF)是非常重要的一种抽象符号表述形式,常用于描述语言的语法、数据格式等。BNF的约定是比较简单的,不过HTTP协议规范中,对标准的BNF做了一些扩充,要想阅读并理解各类规范,掌握BNF基本上是必不可少的。 本文把HTTP协议规范(rfc2616)的2.1章进行翻译对照,以利于大家学习。 注意,本文是意译,并会加入作者的注解,有可能无法与原文一一对照。 2.1 扩展的巴科斯范式 Augmented BNF All of the mechanisms specified in this document are described in both prose and an augmented Backus-Naur Form (BNF) similar to that used by RFC 822 [9]. Implementors will need to be familiar with the notation in order to understand this specification. The augmented BNF [...]

HTTP协议语法(转)

Published on 2010年10月11日 By pangyt

BNF表示的HTTP协议语法 Request      = Request-Line *(( general-header | request-header | entity-header ) CRLF) CRLF [ message-body ] Request-Line = Method SP Request-URI SP HTTP-Version CRLF Method       = “OPTIONS” | “GET” | “HEAD” | “POST” | “PUT” | “DELETE” | “TRACE” | “CONNECT” | extension-method extension-method = token Request-URI  = “*” | absoluteURI | abs_path | authority [...]