开发者

Access CouchDB with XHR using Javascript

I've been looking into CouchDB recently and I'm currently having the problem that I don't know how I would access it using Javascript.

As far as I know at the moment my options are:

  • XHR: Doesn't work. Same-Origin-Policy is in the way. I also don't seem to be able to make CouchDB send the additional Access-Control-Allow-Origin header.
  • JSONP: Limits the request to the GET method.

So how do I a开发者_JAVA百科ccess the database?


CouchDB does not support cross-origin queries at this time. (I have a patch submitted that I expect to be in the next release.)

The vast majority of CouchDB users are doing one of two things:

  1. Serving the web page directly from CouchDB (no cross-origin problems)
  2. Serving web page normally, and the server queries CouchDB, possibly proxying the XHR
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜