0
votes

I have tried to call REST API from Mobile site. Using the following url http://IP_Address:8091/Bucket_Name/Document_Name/

the response is "Not found"

I have refer the below link: http://developer.couchbase.com/documentation/mobile/1.1.0/develop/references/couchbase-lite/rest-api/document/get---db---doc-/index.html#example

My question is, how can I get json response using REST api?

1
Can you post the code for your request to the REST service? Also, I noticed you are not connecting using https, which would mean you need to add an exception to your info.plist for App Transport Security if you are running on iOS 9. - Mr Beardsley
@MrBeardsley I already have added the App Transport Security. The above url (IP_Address:8091/Bucket_Name/Document_Name) I am trying to run on Browser, but not getting any json response? - Pallavi Nikumbh
Did you create the buckets on the Couchbase console port? - sweetiewill

1 Answers

0
votes

You are mixing two different things here. 1. Couchbase Lite - Embedded database similar idea to SQLite - just document - key/value database. 2. Couchbase server - Fully fledged enterprise noSQL\KV\Document database.

You actually have two approaches:

  1. When you are using Couchbase Lite as your mobile app you may need Sync gateway in order to talk back to the couchbase server. The Sync gateway deals with the online updates of your data, while couchbase Lite acts as an offline - online repository of your data. That is the preferred way - as you have the greatest support for you app.

  2. When using only Couchbase server - you can use an SDK to create your calls - or use some REST API available in the REST service - such as views. http://docs.couchbase.com/admin/admin/rest-intro.html

Thanks, Roi