Fix HTTP Accept header for list query Given following list function function(head, req) { provides('text', function(){ start({ 'headers': { 'Content-Type': 'text/plain' } }); send('Hello list!'); }); }It will get HTTP 406 error, because the default Accept header is set to application/json. See Also: couchapp/couchapp#234
Fix HTTP Accept header for list query
Given following list function
function(head, req) { provides('text', function(){ start({ 'headers': { 'Content-Type': 'text/plain' } }); send('Hello list!'); }); }
It will get HTTP 406 error, because the default Accept header is set to application/json.
application/json
See Also: couchapp/couchapp#234
$.couch is used to communicate with a CouchDB server.
Install the dependencies:
$ bower install
Enable CORS:
curl -X PUT http://localhost:5984/_config/httpd/enable_cors -d '"true"' curl -X PUT http://localhost:5984/_config/cors/origins -d '"*"'
Restart CouchDB & open test/runner.html in a browser to run the testsuite.
test/runner.html
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
couchdb-jquery-couch
$.couch is used to communicate with a CouchDB server.
Tests
Install the dependencies:
Enable CORS:
Restart CouchDB & open
test/runner.htmlin a browser to run the testsuite.