Reputation: 2375
How do I send a gzipped request using the dakrone/clj-http client? So far I have:
(http/post <<REDACTED>>
{:body (->> <<REDACTED>>
cheshire.core/generate-string
.getBytes
clj-http.util/gzip)
:content-type "application/json"
:content-encoding "gzip"
:as :json})
But elasticsearch (the server in my case) is giving 500 errors Illegal character ((CTRL-CHAR, code 31)): only regular white space
.
Any ideas?
Upvotes: 0
Views: 501
Reputation: 4101
:content-encoding
is not a recognized keyword for clj-http
. Try :header {"Content-Encoding" "gzip"}
instead.
Upvotes: 0
Reputation: 51541
I guess that you need to enable HTTP compression on the server, e. g. in the Elasticsearch config:
http.compression: true
Upvotes: 0