This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-25
Channels
- # architecture (12)
- # asami (6)
- # aws (2)
- # babashka (2)
- # beginners (71)
- # bristol-clojurians (1)
- # calva (1)
- # cider (2)
- # clojure (136)
- # clojure-australia (6)
- # clojure-dev (14)
- # clojure-europe (11)
- # clojure-italy (3)
- # clojure-nl (2)
- # clojure-sanfrancisco (29)
- # clojure-uk (9)
- # clojuredesign-podcast (12)
- # clojurescript (23)
- # code-reviews (7)
- # core-logic (5)
- # cryogen (7)
- # datomic (7)
- # depstar (7)
- # events (3)
- # fulcro (11)
- # helix (1)
- # jobs (2)
- # juxt (4)
- # kaocha (25)
- # leiningen (2)
- # malli (11)
- # off-topic (8)
- # pathom (1)
- # pedestal (9)
- # portkey (1)
- # reitit (3)
- # ring (2)
- # sci (46)
- # shadow-cljs (21)
- # tools-deps (15)
- # xtdb (31)
I have a sample of two possible directions for an HTTP Client API https://gist.github.com/athomasoriginal/bfcb1e6e9e9bc9d318725a6e7d9315b8 - anyone have a preference and what’s your thought process? :thinking_face:
this might be a good question for #architecture. I personally might prefer option #2, with the caveat that if the first argument is a string, treat it as a url. additionally, I wouldn't have an :opts
key, I would just have whatever keys that would be pass as part of :opts
be part of the map passed in.
although V1 is pretty alright too.
I do like the fact that you can build a map that represents the full request rather than having a url + options as separate pieces that represent a request. it makes request "building" easier
> might prefer option #2, with the caveat that if the first argument is a string
I had the same thought as I was typing it out. I was also toying with the idea of being able to call the same get
function as
(-> (get "url" opts) (.then) (.catch))
;; or
(get {...})
With the idea being we check if the first arg is a string which would make it user’s choice, but I was then worried maybe it’s overcomplicating things> I wouldn’t have an `:opts` key Also agree that I might want to flatten it out