Hi Michael
Not sure if this is the case here, but I have found out, that on the
trunk, when creating a view, I have to replace the forward slashes
with %2F:
PUT /DATABASE_NAME/_design%2Fview
Not needed when getting the contents of a view though:
GET /DATABASE_NAME/_view/view
That works for me anyway.
Best regards
Sebastian
On Apr 25, 2008, at 7:57 AM, Michael Wallner wrote:
Hi,
either I'm doing something awfully wrong, or Mochiweb cannot handle
PUT
at design documents (for views) yet. I'm currently testing trunk
and I
know it worked that way with inets.
HEAD /mbox/_design/view HTTP/1.1
User-Agent: PECL::HTTP/1.6.1-dev (PHP/5.3.0-dev)
Host: localhost:5984
Accept: */*
HTTP/1.1 404 Object Not Found
Server: MochiWeb/1.0 (Any of you quaids got a smint?)
Date: Fri, 25 Apr 2008 10:53:49 GMT
Content-Type: text/plain;charset=utf-8
Content-Length: 0
PUT /mbox/_design/view HTTP/1.1
User-Agent: PECL::HTTP/1.6.1-dev (PHP/5.3.0-dev)
Host: localhost:5984
Accept: */*
Content-Type: text/json
Content-Length: 136
{"language":"text\/javascript","views":{"default":"function (doc) {
map(null, doc); }","from":"function (doc) { map(doc.from, doc); }"}}
HTTP/1.1 405 Method Not Allowed
Server: MochiWeb/1.0 (Any of you quaids got a smint?)
Date: Fri, 25 Apr 2008 10:53:49 GMT
Content-Length: 0
Allow: GET,HEAD
^^^^^^^^^^^^^^^