oreilly / couchdb-guide

CouchDB: The Definitive Guide
http://guide.couchdb.org/
501 stars 139 forks source link

[A Basic Design Document] curl command for uploading design file is wrong. #446

Closed Spredzy closed 6 years ago

Spredzy commented 12 years ago

When executing the command made in the book I get this error

Command:

curl -vX PUT http://127.0.0.1:5984/basic/_design/example -data-binarymydesign.json

Output:

{"error":"bad_request","reason":"invalid UTF-8 JSON: <<\"ata-binarytoto.json\">>"}

After some research the exact query (at least for my os Mac OS X 10.6) would look like this

Command:

curl -vX PUT http://127.0.0.1:5984/basic/_design/example --data-binary @mydesign.json

Output:

{"ok":true,"id":"_design/example","rev":"1-230141dfa7e07c3dbfef0789bf11773a"}

Note the double dash (--) in front of data-binary, followed by a space and then an @ to define the file name.

Yanis Guenane

ghost commented 12 years ago

Also working form OSX10.6 and have the same issue. The fixed command works for me. Thanks!

sghill commented 11 years ago

I think this, and open issue #448, can be closed as a duplicate of resolved issues #415, #422, #428.

The error was fixed in the draft version with commit b3610d