HTTP 协议解析库 fast-http

码农软件 · 软件分类 · 网络工具包 · 2019-02-26 16:42:41

软件介绍

fast-http 是 Common Lisp 语言实现的快速 HTTP 请求和响应的协议解析库,大部分移植自 C 语言版本的 http-parser.

fast-http 的性能比较:

Parsing an HTTP request header 100000 times.

NOTE: Deleted PicoHTTPParser because the benchmark was wrong. It's 3.7 times faster than fast-http. Amazing.

详情请看 Benchmark

使用方法:

(let* ((http (make-http-request))
       (parser (make-parser http
                            :header-callback (lambda (headers)
                                               (my-app:got-headers!!! headers))
                            :body-callback (lambda (bytes)
                                             (my-app:got-body-piece bytes)))))
  (loop for http-data = (my-app:get-http-data-from-request-i-sent-out-earlier) do
    (multiple-value-bind (http headers-finished-p body-finished-p)
        (funcall parser http-data)
      (when body-finished-p
        (my-app:close-http-stream))
      ...)))

本文地址:https://codercto.com/soft/d/187.html

JavaScript

JavaScript

David Flanagan / O'Reilly Media / 2011-5-13 / GBP 39.99

The book is a programmer's guide and comprehensive reference to the core JavaScript language and to the client-side JavaScript APIs defined by web browsers. The sixth edition covers HTML 5 and ECMA......一起来看看 《JavaScript》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

SHA 加密
SHA 加密

SHA 加密工具