Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 69AE810A74 for ; Wed, 13 Nov 2013 14:14:00 +0000 (UTC) Received: (qmail 13408 invoked by uid 500); 13 Nov 2013 14:13:59 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 12915 invoked by uid 500); 13 Nov 2013 14:13:54 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 12902 invoked by uid 99); 13 Nov 2013 14:13:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Nov 2013 14:13:53 +0000 X-ASF-Spam-Status: No, hits=3.2 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of bchesneau@gmail.com designates 209.85.192.181 as permitted sender) Received: from [209.85.192.181] (HELO mail-pd0-f181.google.com) (209.85.192.181) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Nov 2013 14:13:50 +0000 Received: by mail-pd0-f181.google.com with SMTP id p10so455359pdj.26 for ; Wed, 13 Nov 2013 06:13:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=b+mCAAIqlAthSQnEov2IzR78q3IjJ9GMOGt9P3/wZyM=; b=j4TT5nOGNvowIAgDivH1955RRA8oSQXsdTEKPxmhIr2fWIjj3Adwv3iBLzuBrxwGx9 Ww9ldL6qMgrrWQvNV5fio57DPJSZS+wbEVroeBmAQEMpkY7soYTUeYGYi/Rn9byxaJws nE2/QV3Pw8PyhxK8HPJpJ4Z4m705k64QQIeqNt+9KYVeeJlI6Gp/vx0pdxHsN69b6K5P oK1vdMKWDQcxr0KPvbxw54DRhnMqLyjjvyeLDmxWATdpyjYs4krggCLA4uLbhqmLoGlz h/Tvonvk2JeOqX089/9sEdsScYin7Hfin6HnaTCJIdOkEZ+yKtzgPslG5VGTJm9UMGa2 K6OQ== MIME-Version: 1.0 X-Received: by 10.68.129.201 with SMTP id ny9mr41935395pbb.70.1384352009585; Wed, 13 Nov 2013 06:13:29 -0800 (PST) Received: by 10.70.59.7 with HTTP; Wed, 13 Nov 2013 06:13:29 -0800 (PST) In-Reply-To: References: Date: Wed, 13 Nov 2013 15:13:29 +0100 Message-ID: Subject: Re: HTTP request with CouchDB From: Benoit Chesneau To: "user@couchdb.apache.org" , andy@nms.de Content-Type: multipart/alternative; boundary=047d7b10cae5c68bce04eb0f915c X-Virus-Checked: Checked by ClamAV on apache.org --047d7b10cae5c68bce04eb0f915c Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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=3Dma= rkup&pathrev=3D727141 Example: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/couch_tests.js?= view=3Dmarkup&pathrev=3D727141#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 wrote: > On 13 November 2013 13:57, Dave Cottlehuber 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=92re sandboxed to prevent this= . > > > > > I would like to do something like this: > > > > > > > > > function(doc, req) { > > > var http =3D 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=92t guarantee that fun(x) always > > produces the same x=92 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 > --047d7b10cae5c68bce04eb0f915c--