0

如何使用 dakrone/clj-http 客户端发送压缩请求?到目前为止,我有:

(http/post <<REDACTED>>
           {:body (->> <<REDACTED>>
                       cheshire.core/generate-string
                       .getBytes
                       clj-http.util/gzip)
            :content-type "application/json"
            :content-encoding "gzip"
            :as :json})

但是弹性搜索(在我的例子中是服务器)给出了 500 个错误Illegal character ((CTRL-CHAR, code 31)): only regular white space

有任何想法吗?

4

1 回答 1

0

我猜您需要在服务器上启用 HTTP 压缩,例如在 Elasticsearch 配置中:

http.compression: true 
于 2018-09-22T08:34:14.460 回答