gzip - How to post gzipped data to CouchDB? -



gzip - How to post gzipped data to CouchDB? -

as of version 1.6.0, couchdb can take gzipped json request bodies. posting bunch of json files via browser, , beingness able compress them save lot of bandwidth. how create ajax post of gzipped json docs couchdb?

two steps:

compress json files. send ajax request content-encoding: gzip header.

for step 1 can utilize js library. few examples:

js-deflate gzip-js pako

for step 2, using xmlhttprequest can do

xhr.setrequestheader("content-encoding", "gzip");

or using jquery, add

headers: {"content-encoding": "gzip"}

to ajax settings.

couchdb gzip

Comments

Popular posts from this blog

php - How to pass multiple values from url -

database - php search bar when I press submit with nothing in the search bar it shows all the data -

ios - How to load .png images from Documents folder of an app -