On Jan 17, 2014, at 12:04 PM, Francisco Garcia
<[email protected]<mailto:[email protected]>> wrote:
> curl -X PUT -d '{"name":"bob","channel_id":"kuku"}'
> http://localhost:4985/rubase/bob
{"error":"Unsupported Media Type","reason":"Invalid content type
application/x-www-form-urlencoded"}%
Look at what the error message says. You need to set the request Content-Type
to application/json. (Pretty sure CouchDB would complain the same way.)
Actually I recommend switching to HTTPie from curl — it makes sending JSON
requests vastly easier, including automatically setting the content type.
After a while fighting with it, I noticed in the docs that the Admin API does
not seem capable of creating plain documents. Is that right?
No, the admin API is a superset of the regular API.
2. I tried the same operation logged as a user. After a while with no success,
explored the docs and noticed that there is no PUT database/document
Yes, there is. Maybe the docs are wrong; can you show me where it says this?
3. I had some documents already in my CouchBase bucket, so I wanted to see if I
could get them listed with 'all_docs'.
It's possible to make the gateway add metadata to existing docs in the bucket
to make them accessible via the gateway. In the database configuration object
set the property "importdocs" to true, then restart the gateway.
—Jens
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/02C4671D-A56E-45E3-885B-54DE8F4B4D81%40couchbase.com.
For more options, visit https://groups.google.com/groups/opt_out.