This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-02
Channels
- # announcements (1)
- # architecture (1)
- # aws (21)
- # babashka (37)
- # beginners (173)
- # boot (12)
- # chlorine-clover (5)
- # cider (36)
- # clara (11)
- # clj-kondo (25)
- # clojure (128)
- # clojure-europe (7)
- # clojure-finland (3)
- # clojure-germany (2)
- # clojure-nl (57)
- # clojure-uk (23)
- # clojurescript (71)
- # clojurex (1)
- # core-async (30)
- # core-typed (5)
- # cursive (35)
- # datomic (8)
- # duct (4)
- # emacs (8)
- # exercism (41)
- # fulcro (116)
- # jackdaw (4)
- # jobs-discuss (6)
- # juxt (4)
- # kaocha (16)
- # leiningen (14)
- # malli (5)
- # observability (4)
- # off-topic (2)
- # pathom (19)
- # pedestal (29)
- # re-frame (64)
- # reitit (18)
- # ring (8)
- # shadow-cljs (3)
- # sql (13)
- # tools-deps (32)
- # tree-sitter (5)
- # yada (17)
There is a PR for babashka.curl to add parsing of the entire response, including headers and status code: https://github.com/borkdude/babashka.curl/pull/6 If you have any feedback, post in the issue.
$ ./bb '(clojure.pprint/pprint (dissoc (curl/get "" {:response true}) :body))'
{:status 200,
:headers {"x-cache" "Hit from cloudfront",
"server" "AmazonS3",
"age" "50",
"via" "1.1 (CloudFront)",
"content-type" "text/html",
"content-length" "20429",
"x-amz-cf-pop" "AMS54-C1",
"etag" "\"e070cc30536e64dbcabd50ca90ca5a03\"",
"date" "Thu, 02 Apr 2020 08:51:25 GMT",
"vary" "Accept-Encoding",
"last-modified" "Fri, 27 Mar 2020 15:25:37 GMT",
"x-amz-cf-id" "E5NuYdf_gOHJ_vipMfGkq6ujdPxt8apExLOpvbbMC5KodCcD39ILDA=="}}
the map representation seems nice -- but it looks like a deprecated function is being used to achieve it?
it might not be related but it seems similar to the issue I had with ring middleware a long time ago where the one of the middlewares would consume the body upon reading it and the subsequent ones would assume it was empty
But I would prefer to use clojure for this, preferably without starting a repl first
monroe may work too since there is now nrepl support -- oops sorry, not released yet 😅
@chrisblom Please check out the nrepl-server branch. It's under active development.
$ BABASHKA_DEV=true clojure -A:main --nrepl-server 1667
@chrisblom inf-clojure is documented in the README
@chrisblom if you want to try it out, new binary links are published in #babashka_circleci_builds
cool, i'll try it, inf-clojure does not show the eval result inline, like cider does
there may be some rough edges, you can report them in the github issue if you want (https://github.com/borkdude/babashka/issues/301)
The --nrepl-server option is not in the help yet: https://github.com/borkdude/babashka/pull/322
on master, babashka.curl now can return a map with :body
, :headers
and :status
:
$ bb '(-> (curl/get "" {:response true}) :headers (get "content-length"))'
"20429"
no problem 🙂 pleasure's all mind... I learned a lot about InputStream & Reader as part of the process haha
I had a random thought today and would like to bounce it here to see if it lands on the silly floor or sticks to the wall of interest… When sci
is configured with the :termination-safe
preset, you can’t use dotimes
because that delegates to the forbidden loop
. I was thinking of supplying an alternate implementation that instead delegates to doseq
combined with range
.
we had a similar issue with for
which also uses loop
, I think we just have to fix dotimes
in a similar fashion. feel free to post an issue and if you want also a PR. maybe you can find in the history how we fixed this (check the history for the for macro .cljc file)
Ok, cool, I’ll post the issue, and see if I have time to propose a PR. So many projects, so little time! 😄
That was fast! And settles the PR question. 😆 Thanks!