Making HTTP requests with Clojure -


i've started learning clojure , struggling api changes on past few years. in particular, in 1.2 there http-agent function in contrib allowed simple http requests:

 (http-agent "http..." :method "post" :body "foo=1")  

this function removed , seems should either use clojure.java.io or 3rd party solution http-kit or clj-http.

i'm surprised java.io seems lower-level , loses simplicity or http-agent , making http requests seems should in core set of libraries (i realise subjective).

what's rationale removal of http-agent? did not fit core philosophy of clojure? , recommendations best library use basic http requests?

i cannot make authoritative statements reasons why particular part of old contrib failed make new contrib, in general things moved on when sufficiently many people interested, including able , willing maintain new libraries. perhaps in case there wasn't enough interest.

additionally, extremely straightforward build clojure projects on top of multiple libraries , not clear presence of http client library in core set of libraries or contrib make things simpler and/or easier developers now, excellent options available in wider ecosystem.

as particular examples of such excellent options, i'd point towards clj-http , http.async.client (in alphabetical order; 1 appropriate depends on whether you'd benefit firing off requests asynchronously).


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -