rpl*_*evy 33
用于与外部REST API交互的好库是clj-http,它使用Apache HTTPClient.对于JSON,有几个选项:clojure.data.json(核心库)和cheshire是一些流行的选项.lib clj-http将cheshire作为依赖项,并且已经提供了JSON支持.Theshire使用了Jackson.
例如,使用clj-http:
(ns my.core
(:require [clj-http.client :as client]))
(client/put my-url
{:form-params body
:content-type :json
:oauth-token @token
:throw-exceptions false
:as :json})
Run Code Online (Sandbox Code Playgroud)