What are rewrites from/to needed to allow POST?

20 views
Skip to first unread message

Mark Deibert

unread,
Oct 11, 2013, 3:12:22 PM10/11/13
to couc...@googlegroups.com
Thanks to "llabball" I have the vhost set correctly. That got me past the first hurdle. Right now, the app is working for all GETs but the form POST doesn't work. In the application, the http.post methods, of course, look like "POST http://localhost:5984/databaseName". The rewrites from/to handlers appear to be blocking this because I get "405 Method not allowed" error. I'm not sure how to work past this. What do I need to add to my rewrites json?

llabball

unread,
Oct 22, 2013, 4:57:05 AM10/22/13
to couc...@googlegroups.com
not the rewrite handler is blocking - the design doc handler it forwarding to is

e.g. if you want to catch a POST simply set the method to POST in your directive and forward to a design doc handler that excepts POST's

{
  "from": "/endpoint/:docid",
  "to": "_update/doc/:docid",
  "method": "POST"
}

an update handler for example will respond a error when you try to use it with a get

you problem is perhaps that you haven't set any method yet? (otherwise pls post your rewrites.json)

Reply all
Reply to author
Forward
0 new messages