incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Chesneau <bchesn...@gmail.com>
Subject Re: HTTP request with CouchDB
Date Wed, 13 Nov 2013 14:13:29 GMT
It was possible with the old action.js and may work without too much
changes today:

http://svn.apache.org/viewvc/couchdb/trunk/share/server/action.js?view=markup&pathrev=727141

Example:

http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/couch_tests.js?view=markup&pathrev=727141#l2035

You have to lad it with the main.js in couchjs script.

- benoit


On Wed, Nov 13, 2013 at 2:16 PM, Andy Wenk <andy@nms.de> wrote:

> On 13 November 2013 13:57, Dave Cottlehuber <dch@jsonified.com> wrote:
>
> > On 13. November 2013 at 13:49:12, Hank Knight (hknight555@gmail.com)
> > wrote:
> > >
> > > Is it possible to send an HTTP request and receive a result with
> > > CouchDB?
> >
> > Inside view/show/list/filters , no. They’re sandboxed to prevent this.
> >
> > > I would like to do something like this:
> > >
> > >
> > > function(doc, req) {
> > > var http = new XMLHttpRequest();
> > > http.open( "GET", "http://abomination-deleted.xml",
> > > false );
> > > http.send( null );
> > > emit("xyz",http.responseText);
> > > }
> >
> > The reason is that each doc should be idempotent; if you can mix into
> your
> > view external results then CouchDB can’t guarantee that fun(x) always
> > produces the same x’ as result.
> >
> > A+
> > Dave
> >
>
> I understood the question in a more basic way. Means if it's possible to
> request CouchDB form a JavaScript file like it is done in Futon ...  sry if
> I pointed to the wrong path ...
>
> Cheers
>
> Andy
>
> --
> Andy Wenk
> Hamburg - Germany
> RockIt!
>
> http://www.couchdb-buch.de
> http://www.pg-praxisbuch.de
>
> GPG fingerprint: C044 8322 9E12 1483 4FEC 9452 B65D 6BE3 9ED3 9588
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message