How do I send gzipped data to CouchDB?
1 answer
Two steps:
- Compressing JSON files.
- Send an AJAX request with a header
Content-Encoding: gzip
.
For the first step, you can use the JS library. A few examples:
For step 2, using XMLHttpRequest you can do
xhr.setRequestHeader("Content-Encoding", "gzip");
or using JQuery add
headers: {"Content-Encoding": "gzip"}
in the ajax settings .
0
source to share