I'm trying to figure out how to write to couchdb using REST: command line syntax for creating a database is:
Code: Select all
curl -X PUT http://127.0.0.1:5984/mydatabase
regards
Code: Select all
curl -X PUT http://127.0.0.1:5984/mydatabase
Code: Select all
(set 'the-db {http://admin:password@localhost:5984/mydatabase})
(post-url the-db {} {8000})
(sleep 8000)
(exit)
If the admin:password bit is left out, the response is the same."ERR: DNS resolution failed"
Code: Select all
(post-url "http://localhost:5984/mydatabase"
"user=admin&password=password"
"application/x-www-form-urlencoded" 8000)
I misunderstood. I thought you were trying to curl up on your futon couch for some REST this April.jazper wrote: (sleep) hasn't helped yet. ...
Code: Select all
(set 'the-db {http://localhost:5984/the_hucklebuck})
(put-url the-db {})
(exit)
Code: Select all
(set 'the-db "http://127.0.0.1:5984/mynewdbthree")
(set 'auth "user=my_admin_name&password=my_password" )
(set 'encode "application/x-www-form-urlencoded" )
(put-url the-db auth encode 8000)
(exit)
Code: Select all
"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\r\n"