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)
Am I missing something here?
I’m unable to reproduce a working curl multipart upload:
curl -X POST -F "file=@foo.jpg" "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.^cc @kachayev — sorry for the ping but I noticed you contributed that feature
@jfntn I’m not sure it’s enough information for me to troubleshoot this
Would you please DM me entire request/response?
@kachayev can do in 30 min, commuting now
FYI tried clj-http and it works with the same params