On Feb 14, 2014, at 8:01 AM, Joel Saltzman <[email protected]> wrote:

> I tried:
> curl -X POST -u Administrator:mypass 
> http://127.0.0.1:8091/beer-sample/_user/jens --data 
> '{"name":"jens","email":"[email protected]","password":"1234"}}'

Port 8091 is Couchbase Server, not the Sync Gateway.

> I also tried the admin port:
> curl -X PUT http://127.0.0.1:4985/beer-sample/_user/jens --data 
> '{"name":"jens","email":"jens@ someemail.com","password":"1234"}}'
> I receive:
> Failed connect to 127.0.0.1:4985; Connection refused

"Connection refused" implies the gateway isn't running. (Tech support: "Is your 
computer turned on?" :)

Also, even after you start the gateway I think that request will be rejected 
(with a 400) because it's not declared as JSON. You'll need to add a 
"Content-Type: application/json" header. This gets somewhat awkward with curl; 
I much prefer httpie, which lets me write that as
        http PUT :4985/beer-sample/_user/jens name=jens 
[email protected] password=1234

(But if you stick with curl, it also lets you omit the "http://127.0.0.1"; 
prefix of the URL. Saves a lot of typing in the long run!)
(Also, you can skip the "name=jens" part because the name's already specified 
in the URL.)

--Jens

PS: If something in the docs led you astray, please let us know where the 
problematic part is so we can clarify or fix it. Thanks!

-- 
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/DBF4C261-7AC1-4A7F-AE69-0EE3088C57C6%40couchbase.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to