incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mike <>
Subject AJAX POST from Local client to -- gives 405 Method not allowed
Date Tue, 01 Feb 2011 18:35:34 GMT
Using just my local browser (and a little jQuery -latest == 1.5)  I am
trying to add a field to an existing document stored on my
couchone.comaccount.   (In the configuration file I have set:
*allow_jsonp = true)*

This code runs in the Firebug console and creates this uri, which does not
seem to contain my name && password:{field2:%22myData%22,_rev:1-15f65339921e497348be384867bb940f}

The result of this request is a 405 message (method not allowed).

urlDB =""; // the database name is *
doc = "489118d421996869057c5cd9fd000bbb";  // correct document id
rev = "1-15f65339921e497348be384867bb940f";
addField = '? -d {field2:"myData",_rev:'+rev+'}'; // hopefully the cmd
needed to add a new field to the doc

  type:'PUT',  // POST also gives the 405 message.
  url: urlDB+doc+addField,  // seems correct
  dataType: 'json',
  data:{name:'myname', password:'mypassword'},
  success: function(Response){ console.log('success response is: \n',
Response) },
  error: function(XMLHttpRequest, textStatus,
errorThrown){console.log('errors here\n',textStatus, errorThrown); },
  complete: function(req) {console.log("\n completed \n", req);}

Changing the dataType to jasonp, results in success, but what is returned is
the unmodified original document.

Also, with jsonp,  params tab shows name and password are being passed like

Am I missing something else here?  Is it possible to POST from a local
browser or is this some sort of cross-domain issue that needs more on the

Advice, working examples, much appreciated.

Mike Behar

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