couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hankey, Chris" <Chris.Han...@Transamerica.com>
Subject Call to View returns 405. It's using OPTIONS not GET
Date Sat, 19 May 2012 21:53:40 GMT
I'm trying to call a view using the CouchDB Javascript API.  The $db.view call is failing with
a "405 Method Not Allowed" error.  $db.view is generating the correct URL, but the call appears
to be failing because the view function is using HTTP OPTIONS method ( or maybe JQuery). 
If I change the HTTP method to GET & manually send the HTTP request, then it works fine.
 I need $db.view to generate a GET.  Any thoughts?

Thanks

Chris

-----------
Sample Code
-----------

  $.couch.urlPrefix ="http://test:5984"
  $db = $.couch.db("forms");


  function GetFormList() {  
   $("div#forms").empty();  
   $db.view("formviews/formlist", {  
    success: function(data) {  
     for (i in data.rows) {  
      id = data.rows[i].id;  
      html = '<div class="form">' +  
       '<span class="form">' + id + '</span> ' +  
       '<a href="#" class="edit">edit</a> '+  
       '<a href="#" class="delete">delete</a> '+  
       '</div>';  
      $("div#forms").append(html);  
     }  
   }});  
  }  


Mime
View raw message