This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-05
Channels
- # adventofcode (419)
- # aleph (8)
- # aws (6)
- # beginners (148)
- # boot (9)
- # cider (24)
- # cljs-dev (37)
- # cljsjs (8)
- # clojure (134)
- # clojure-android (6)
- # clojure-brasil (15)
- # clojure-dev (8)
- # clojure-dusseldorf (2)
- # clojure-greece (67)
- # clojure-italy (8)
- # clojure-japan (3)
- # clojure-russia (3)
- # clojure-spec (8)
- # clojure-uk (13)
- # clojurescript (54)
- # clojurex (6)
- # cursive (5)
- # data-science (12)
- # datomic (15)
- # defnpodcast (11)
- # emacs (25)
- # fulcro (95)
- # graphql (3)
- # lein-figwheel (1)
- # leiningen (27)
- # luminus (1)
- # lumo (6)
- # mount (2)
- # off-topic (112)
- # om (3)
- # onyx (24)
- # perun (3)
- # re-frame (20)
- # reagent (1)
- # reitit (2)
- # ring-swagger (13)
- # rum (10)
- # shadow-cljs (45)
- # spacemacs (24)
- # sql (2)
- # unrepl (78)
- # yada (1)
aleph.http.encoding> (encode-base64 "val")
ClassCastException java.nio.HeapByteBuffer cannot be cast to io.netty.buffer.ByteBuf aleph.http.encoding/encode-base64 (form-init3445602468191842931.clj:34)
I’m unable to reproduce a working curl multipart upload:
curl -X POST -F "[email protected]" "http://..."
With aleph’s http client I have:
(http.client/request
{:url "http://..."
:request-method :post
:multipart [{:part-name "file"
:name "foo.jpg"
:mime-type "image/jpeg"
:content (io/file (io/resource "foo.jpg"))}]})
The request goes through but the server is not reading the data correctly, I inspected the requests with Postman and realized the Content-Length header is completely different, as well as the encoding.
That’s when I ran into the ClassCastException trying to set the :transfer-encoding
to :base64
on the part.