https://github.com/edicl/drakma

加载库

  1. (ql:quickload "drakma")

HTTP GET

  1. (drakma:http-request entry)

HTTP POST

  1. (setf text nil)
  2. (setf es-index (multiple-value-bind (second minute hour day month year)
  3. (get-decoded-time)
  4. (format nil "oplogs_scheduler_~4,'0d~2,'0d~2,'0d*" year month day)))
  5. (setf url (format nil "http://mvp-hadoop172:9200/~a/_search" es-index))
  6. (setf body (uiop:read-file-string "body.json"))
  7. (setf text (nth-value 0 (drakma:http-request url
  8. :method :post
  9. :content body
  10. :accept "application/json"
  11. :content-type "application/json"
  12. :basic-authorization '("elastic" "elastic")
  13. :want-stream t)))
  14. (setf (flexi-streams:flexi-stream-external-format text) :utf-8)
  15. (setf data (yason:parse Text :object-as :hash-table))
文档更新时间: 2019-07-05 20:54