輕巧,異步HTTP客戶端:Carrier

jopen 10年前發布 | 10K 次閱讀 Carrier 網絡工具包

Carrier 是一個輕量級,異步HTTP客戶端。構建在 cl-asyncfast-http 之上。

其目的是通過HTTP實現簡單和高效的流數據。它與drakma-async類似。

request (function)

(defun request (url &key (method :get) headers body store-body header-callback body-callback finish-callback))
  => promise

Perform an HTTP request. Returns a promise (to be used withcl-async-future) that is finished when the response has fully downloaded.

  • url - the URL we're requesting.
  • method - a keyword method (:get, :post, etc). Defaults to :get.
  • headers - a hash table or plist of headers to set with the request. Note that the "Host" header is set automatically (if not proveded) and if the body argument is passed, then "Content-Length" is set as well.
  • body - A string or byte array to send as the HTTP body. If present, will set the "Content-Length" header automatically in the request.
  • store-body - If T, will store the entire HTTP response body and finish the returned promise with it once complete. If this is left nil, then the first value of the finished promise will be nil.
  • header-callback - A function that is called once the headers from theresponse are fully parsed. The only argument is a hash table of headers.

項目主頁:http://www.baiduhome.net/lib/view/home/1416207237352

     本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
     轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
     本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!