couchdb
couchdb copied to clipboard
Deflate compression for requests
CouchDB REST API does not seem to support requests with Deflate compression. On the contrary, this is the only method that HTTPie offers, which can make it difficult to use against the API when compression comes into question. For example, assuming that database test has been created on localhost and docs.json contains the uncompressed body of the request:
$ http --compress post http://adm:pass@localhost:15984/test/_bulk_docs @docs.json
HTTP/1.1 415 Unsupported Media Type
Cache-Control: must-revalidate
Content-Length: 85
Content-Type: application/json
Date: Tue, 28 Mar 2023 12:42:42 GMT
Server: CouchDB/3.3.1-467e14e (Erlang OTP/24)
X-Couch-Request-ID: 55b8b8f5ca
X-CouchDB-Body-Time: 57
{
"error": "bad_content_type",
"reason": "deflate is not a supported content encoding."
}
Add support for this content type to make http work in such scenarios.