Home

Awesome

Carrier

Carrier is a lightweight, async HTTP client built on top of cl-async and fast-http.

Its goal is to allow easy and efficient streaming of data over HTTP. It is the lightweight cousin to drakma-async.

Documentation

request (function)

(defun request (url &key (method :get) headers body cookie-jar return-body header-callback body-callback finish-callback (redirect 5) redirect-non-get timeout))
  => promise

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

(lambda (headers) (gethash "content-type" headers))
(lambda (chunk start end)
  ;; here's how you'd get the actual bytes. note that most stream functions
  ;; take :start and :end functions, so we don't actually have to do a subseq
  ;; to send the chunk where we need it to go
  (subseq chunk start end))
(lambda () ...)
(lambda (redirecting-url headers) ...)

License

MIT!!