Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle GET with open_revs #4

Open
OrangeDog opened this issue Sep 5, 2011 · 5 comments
Open

Handle GET with open_revs #4

OrangeDog opened this issue Sep 5, 2011 · 5 comments
Assignees

Comments

@OrangeDog
Copy link

At the moment you can do the following, which will not work as the JSON parser is given the raw multi-part response.

$db->open_doc($id, {'open_revs' => 'all'})->recv;

Presumably this should return an array of all the versions (and probably ignore any attachments in the response).

@ghost ghost assigned beppu Sep 5, 2011
@beppu
Copy link
Owner

beppu commented Sep 5, 2011

I was unable to replicate this bug, because CouchDB sent me parseable JSON when I tried this. I'm curious to see what kind of response you're getting from CouchDB, so could you use curl to make a similar request, and paste the response that CouchDB gives you, please?

curl 'http://localhost:5984/test/da173e45950d5a80a20b54600c000fd1?open_revs=all'

^Do something like that w/ the db and id replaced to fit your database and paste the result here.

@OrangeDog
Copy link
Author

From couchdb-1.1.0+COUCHDB-1152 OTP/R14B01+OTP-9139 Win32

HTTP/1.1 200 OK
Transfer-Encoding: chunked
Server: CouchDB/1.1.0 (Erlang OTP/R14B01)
Date: Tue, 06 Sep 2011 08:51:15 GMT
Content-Type: multipart/mixed; boundary="3c39738dd1c940813b235430c88cc542"

--3c39738dd1c940813b235430c88cc542
Content-Type: application/json

{/* JSON for head revision */}
--3c39738dd1c940813b235430c88cc542
Content-Type: application/json

{/* JSON for a deleted conflict */}
--3c39738dd1c940813b235430c88cc542--

When there are attachments, the attachment stub has "follows": true and there is an additional (untyped) part containing the unencoded data for each attachment.

@OrangeDog OrangeDog reopened this Sep 6, 2011
@beppu
Copy link
Owner

beppu commented Sep 6, 2011

Thanks. I'm going to try to make some conflicts happen in my db to try to make it send me a multipart/mixed response.

@OrangeDog
Copy link
Author

I think it's only with version 1.1 that it's started doing it: 1.0.3 just returns a JSON array.

@beppu
Copy link
Owner

beppu commented Sep 6, 2011

That's good to know. I'll try to accomodate both if I can.

Repository owner deleted a comment from litty-tt Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@beppu @OrangeDog and others