You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "nickva (via GitHub)" <gi...@apache.org> on 2023/06/15 14:27:37 UTC

[GitHub] [couchdb] nickva commented on issue #4642: DOCUMENTATION - Creating a new user method HTTP method is wrong

nickva commented on issue #4642:
URL: https://github.com/apache/couchdb/issues/4642#issuecomment-1593175564

   > since the PUT method will try to create the _users database. The correct HTTP method is POST.
   
   PUT should not create a new database but a new user document
   
   The URL is `http://localhost:5984/_users/org.couchdb.user:jan` `_users` is the database and `org.couchdb.user:jan` is the document ID. PUT is also the correct method in this case as we're creating or replacing a resource and we're identifying by its resource (the URL path).
   
   Maybe we should assert or include that we are assuming in the documentation that `_users` db has already been created  and the `jan` user has not been added to it yet.
   
   Good point however that this needs an admin user and admin password. That is mentioned above in [Authentication Database](https://docs.couchdb.org/en/stable/intro/security.html#authentication-database) but that may be easy to miss so showing it in the example would make it easier to see.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org