Fork me on GitHub
#aleph
<
2019-10-02
>
sofra04:10:37

when using the HTTP client how it seem to uncompress the body of the 200's but not of other statuses, how do I get around this?

cddr22:10:05

I do this using the chain operator from manifold. e.g.

(d/chain (http/get "" get-params)
  (fn [response]
     (if (ok? response)
        (inflate (:body response))
        (throw (ex-info "request failed" {})))))

cddr22:10:33

This will give you a deferred. When you deref it, you'll get either the decompressed body or an exception will be thrown.