问题
I'm sending a POST request to add Document to Couchbase Server via Sync Gateway Server. I'm using serviceconfig.json, similar to link. server key in "databases" contains a link to my Couchbase Server (http://localhost:8091). While firing the POST request, it shows a response shown below. Also, I have added the logs below,
404 no such database "fineract-cn"
400 invalid database name "favicon.ico"
回答1:
The response indicate you are not posting a doc with a proper user authentication. You need firstly create a session with username/password:
https://docs.couchbase.com/sync-gateway/2.1/rest-api.html#/session/post__db___session
the POST session request will return a cookie and a session id, in your _bulk_docs, you need to attach the cookie in your POST request.
来源:https://stackoverflow.com/questions/57507786/status-403-sg-wrong-user-while-using-couchbase