Trying to do some basic operations with CouchDB via it's REST interface. Running curl from the command line works perfectly but trying from LiveCode is currently only partially working. I guess it's me but if someone could share some light I would be really grateful!
Example 1
I would like to create a new CouchDB data base. The working curl for this is:
Code: Select all
curl -u user:passwd -X PUT http://127.0.0.1:5984/newdb
-or-
curl -X PUT http://user:passwd@127.0.0.1:5984/newdb
Code: Select all
put empty into url "http://user:password@127.0.0.1:5984/newdb
Example 2
If I try to insert data into already existing database. i.e. the curl equivalent of:
Code: Select all
curl -X PUT http://user:passwd@127.0.0.1:5984/mydb/my-test-post -d '{"hello":"world"}'
Code: Select all
put "{" & q("World") & colon & q("Hello") & "}" into url "http://user:passwd@127.0.0.1:5984/mydb/my-other-test"
So, I guess there is something going on when I try to use put but doesn't in fact "PUT" anything...
BTW
Code: Select all
delete url http://user:passwd@127.0.0.1:5984/mydb
Any ideas anyone?