我从 https://github.com/btnguyen2k/gocosmos 那里得到了Azure CosmosDB的go-sql-driver。
当我打电话给gocosmos时,它很顺利。NewRestClient 获取 rest 客户端,CreateDatabase() 创建数据库,CreateCollection() 创建集合。
问题是当我使用CreateDocument()时,我得到状态码401和正文的响应,如下所示
{"code":"Unauthorized","message":"The input authorization token can't serve the request. Please check that the expected payload is built as per the protocol, and check the key being used. Server used the following payload to sign: 'post\ndocs\ndbs/ToDoList/colls/Items\nmon, 31 may 2021 13:31:44 gmt\n\n'\r\nActivityId: a9bbd729-3495-400f-9d79-ddec3737aa92, Microsoft.Azure.Documents.Common/2.11.0"}
我已经尝试了我见过的所有解决方案,但我还没有解决问题。
慕雪6442864
相关分类