Hi there, I’m new to Couchbase and am trying to get some of the basics down. I’ve been able to mess with the todo lite app hooked up to a sync gateway and can see my created docs on the iPhone get inserted in the Couchbase server (through the sync gateway).
I wanted to now learn a little more about how to use the REST API and am getting a little stuck, or perhaps just a little confused. So I’m on the local server where I have both the sync gateway and the Couchbase database. I navigate to the Public REST API page for the sync gateway (https://developer.couchbase.com/documentation/mobile/current/references/sync-gateway/rest-api/index.html#/database) and wanted to try two different things.
-
Getting basic meta-information about the server. When I click on the “Try it out!” button, I receive “error”:“no response from server” in the response headers section. I noticed that the request URL is “https://localhost/4984/”. Is that supposed to be “https” and not “http”? There’s no option for this REST API so I know I’m not messing up on the request.
-
Manually adding a document to the todo database. I’m using the database operations with POST /{db}/_bulk_docs. Again, I’m putting in “todo” as the database name and entering a very basic JSON document. Like the above point #1, I see the URL formatted as “https” instead of “http” and I’m not receiving any response.
I did add the CORS section to the config file and restarted Couchbase.
Any thoughts or explanation would be much appreciated. I spent over an hour trying to search through the forums to find actual examples but I haven’t had any luck with that.
Thanks,
David