How do I go about making an HTTP request in a Clojure Android project?
- neither
clj-http
norhttp-kit
seem to be Android-friendly - the approach in this question gives a
android.os.NetworkOnMainThreadException
Attempting to resolve that Exception
according to the answers given here has various problems. The preferred solution (using AsyncTask
) requires subclassing, and I'm not entirely clear how to write Clojure code that does so. Trying to change StrictMode
settings results in namespace-related errors. Finally, starting up a new thread to handle the web request with (.start (Thread. (fn [] ...)))
crashes out the app entirely in testing.
So, once more: how do I go about making an HTTP request in an Android application written using Clojure Android?