Androidからclojure/compojureサーバーにjsonデータを送信しようとしています
しかし、データを適切に送受信できないようで、問題が Android にあるのか、compojure にあるのかよくわかりません。
ここにJavaコードがあります
String PATH = "http://localhost:8080/get_position";
DefaultHttpClient mClient = new DefaultHttpClient();
HttpGet httpget = new HttpGet(PATH);
HttpResponse response;
httpget.getParams().setParameter("measurements", measurements.toString());
response = mClient.execute(httpget);
HttpEntity entity = response.getEntity();
ここで、測定値は JSON オブジェクトです。
そして、ルーティングを処理するための主要な構成コード
(defroutes main-routes
(POST "/get_position" {params :params}
(emit-json (find-location (:results (read-json (:measurements params))))))
(route/not-found "Page not found"))
リクエストはちゃんと受け取れるのですが、params is nil というエラーが出ます
java.lang.IllegalArgumentException: No implementation of method: :read-json-from of protocol: #'clojure.data.json/Read-JSON-From found for class: nil
このコードに問題がある人、またはこれを行う正しい方法を知っている人はいますか?