This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-15
Channels
- # announcements (71)
- # architecture (2)
- # aws (41)
- # babashka (23)
- # beginners (80)
- # calva (26)
- # chlorine-clover (11)
- # cljfx (4)
- # cljs-dev (12)
- # clojure (78)
- # clojure-berlin (5)
- # clojure-czech (3)
- # clojure-dev (9)
- # clojure-europe (45)
- # clojure-france (16)
- # clojure-gamedev (2)
- # clojure-italy (3)
- # clojure-nl (4)
- # clojure-spec (8)
- # clojure-sweden (1)
- # clojure-uk (37)
- # clojurescript (18)
- # community-development (15)
- # conjure (30)
- # cursive (51)
- # datomic (16)
- # duct (19)
- # figwheel-main (3)
- # fulcro (23)
- # java (7)
- # jobs (2)
- # joker (10)
- # off-topic (7)
- # parinfer (1)
- # pathom (6)
- # reagent (5)
- # reitit (1)
- # remote-jobs (1)
- # sci (1)
- # shadow-cljs (55)
- # slack-help (3)
- # specter (4)
- # sql (21)
- # tools-deps (11)
- # vim (5)
- # xtdb (14)
@borkdude I don't know if you already discovered the limitations of the local-echo-controller? it's not really suitable for lisp, quoting will not work as you would expect
Fixed in babashka/local-echo, issue/PR here: https://github.com/wavesoft/local-echo/issues/30
@plexus yes, I’m working on a fork of the local-echo-controller for that. We basically control incomplete input ourselves instead of needing that part of the plugin to do it for us
that's good, local-echo-controller does too much, it should really do only exactly as much as a unix line discipline driver
@plexus in general a text area with some Clojure syntax plugin may be more ergonomic for web (we already have sci.web playground) but this is a fun idea of yours! Further discussion in #sci
hello! I'm trying to talk to an api with babashka curl. Can anyone tell me what is malformed about this request?
(curl/put ""
{:headers {"PRIVATE-TOKEN" "itIsSecret"
"Content-Type" "application/json"}
:form-params {"description" "I am renaming this pipeline schedule"}})
I got an unwrapped curl command to succeed with this, so I guess the above is not equivalent to the command I used
@mathpunk if you invoke curl with :debug true
it will also include the command in the ex-data
:
"curl" "--silent" "--show-error" "--location" "--dump-header" "/var/folders/2m/h3cvrr1x4296p315vbk7m32c0000gp/T/babashka.curl5567161590767606780.headers" "--request" "PUT" "-H" "PRIVATE-TOKEN: itIsSecret" "-H" "Content-Type: application/json" "--form" "description=I am renaming this pipeline schedule" ""
Maybe that will help you debughmm, same result I think: status 400. The output:
----- Error --------------------------------------------------------------------
Type: clojure.lang.ExceptionInfo
Message: babashka.curl: status 400
Location: /Users/tomhenderson/lg/tools/./jobs.clj:125:1
----- Context ------------------------------------------------------------------
121: :body
122: (json/parse-string))
123:
124:
125: (curl/put " "
^--- babashka.curl: status 400
126: {:headers {"PRIVATE-TOKEN" token
127: "Content-Type" "application/json"}
128: :form-params {"description" "I am renaming this pipeline schedule"}
129: :debug true})
----- Stack trace --------------------------------------------------------------
babashka.curl/put - <built-in>
user - /Users/tomhenderson/lg/tools/./jobs.clj:125:1
I thought maybe my error was to put both :headers
and :form-params
in the same map but I guess not
@mathpunk Could be a bug in babashka/curl. Can you try if this works with e.g. clj-http or httpkit? Next release will have the latter
@mathpunk Yes, the output is the same but there is extra data in the exception, which you can get with (ex-data *e)
, e.g. (:command (ex-data *e))
alas, first time writing a babashka script, I seem to not quite understand how to require clj-http :thinking_face: or print the ex-data
(do
(curl/put " "
{:headers {"PRIVATE-TOKEN" token
"Content-Type" "application/json"}
:form-params {"description" "I am renaming this pipeline schedule"}
:debug true})
(pprint (:command (ex-data *e))))
@mathpunk I think I understand the problem. You state: content-type application/json, but that's not what you're sending