Packrat 解析 HTTP
有人可以告诉我如何使用 scala 2.8 packrat-parsing 解析 HTTP 协议吗?
我需要将附加的示例 HTTP 响应解析为
- ResponseStatusCode:Int
- Headers:List[(String,String)]
- Body: String, Array[Byte], CharBuffer 或任何
Packrat-Parser 的简短示例用法非常感谢。谢谢!
HTTP/1.1·200·OK(CR)(LF)
Date:·Thu,·27·May·2010·12:18:48·GMT(CR)(LF)
Server:·Apache(CR)(LF)
Vary:·Accept-Encoding,User-Agent(CR)(LF)
Connection:·close(CR)(LF)
Transfer-Encoding:·chunked(CR)(LF)
Content-Type:·text/html;·charset=utf-8(CR)(LF)
(CR)(LF)
... Hello World ..
could somebody give me a start on how to parse the HTTP-protocol with scala 2.8 packrat-parsing?
I need to parse attached examplary HTTP Response into
- ResponseStatusCode:Int
- Headers:List[(String,String)]
- Body: String, Array[Byte], CharBuffer
or whatever
Short examplary usage of a Packrat-Parser very much appreciated. Thanks!
HTTP/1.1·200·OK(CR)(LF)
Date:·Thu,·27·May·2010·12:18:48·GMT(CR)(LF)
Server:·Apache(CR)(LF)
Vary:·Accept-Encoding,User-Agent(CR)(LF)
Connection:·close(CR)(LF)
Transfer-Encoding:·chunked(CR)(LF)
Content-Type:·text/html;·charset=utf-8(CR)(LF)
(CR)(LF)
... Hello World ..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有丰富的有关使用 Scala 组合器解析器库的在线资源。
There are abundant on-line resources about using Scala's combinator parser library.